001/* 002 * Copyright 2022-2026 Revetware LLC. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package com.soklet; 018 019import org.jspecify.annotations.NonNull; 020import org.jspecify.annotations.Nullable; 021 022import javax.annotation.concurrent.ThreadSafe; 023import java.math.BigDecimal; 024 025/** 026 * Request-scoped progress reporting seam for MCP tool calls. 027 * 028 * @author <a href="https://www.revetkn.com">Mark Allen</a> 029 */ 030@ThreadSafe 031public interface McpProgressReporter { 032 /** 033 * Provides the progress token associated with the current request. 034 * 035 * @return the progress token 036 */ 037 @NonNull 038 McpProgressToken getProgressToken(); 039 040 /** 041 * Emits an MCP {@code notifications/progress} update for the current request. 042 * 043 * @param progress the current progress value 044 * @param total the optional total value used to interpret {@code progress} 045 * @param message an optional human-readable progress message 046 */ 047 void reportProgress(@NonNull BigDecimal progress, 048 @Nullable BigDecimal total, 049 @Nullable String message); 050}