Skip to content

Commit 4670f20

Browse files
tzolovYunKuiLu
andcommitted
ref docs updates
Signed-off-by: Christian Tzolov <[email protected]> Co-authored-by: YunKui Lu <[email protected]>
1 parent 8576ebf commit 4670f20

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/mcp/mcp-client-boot-starter-docs.adoc

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,12 +489,28 @@ If no custom generator bean is provided, the default generator (using prefix gen
489489
The MCP Client Boot Starter supports customizable conversion of Spring AI's xref:api/tools.adoc#_tool_context[ToolContext] to MCP tool-call metadata through the `ToolContextToMcpMetaConverter` interface.
490490
This feature allows you to pass additional contextual information (e.g. user id, secrets token) as metadata along with the LLM's generated call arguments.
491491

492-
By default, if no custom `ToolContextToMcpMetaConverter` bean is provided, the starter uses `ToolContextToMcpMetaConverter.defaultConverter()` which:
492+
For example you can pass the MCP `progressToken` to your link:https://modelcontextprotocol.io/specification/2025-06-18/basic/utilities/progress#progress-flow[MCP Progress Flow] in the tool context to track the progress of long-running operations:
493+
494+
[source,java]
495+
----
496+
ChatModel chatModel = ...
497+
498+
String response = ChatClient.create(chatModel)
499+
.prompt("Tell me more about the customer with ID 42")
500+
.toolContext(Map.of("progressToken", "my-progress-token"))
501+
.call()
502+
.content();
503+
----
504+
505+
By default, if no custom converter bean is provided, the starter uses `ToolContextToMcpMetaConverter.defaultConverter()` which:
493506

494507
* Filters out the MCP exchange key (`McpToolUtils.TOOL_CONTEXT_MCP_EXCHANGE_KEY`)
495508
* Filters out entries with null values
496509
* Passes through all other context entries as metadata
497510

511+
512+
513+
498514
You can customize this behavior by providing your own implementation:
499515

500516
[source,java]

0 commit comments

Comments
 (0)