Skip to content

Commit dc4fda9

Browse files
authored
docs(java-quickstart): update tool registration method in java client quickstart (modelcontextprotocol#465)
Update client.mdx to reflect breaking change replacing the `.defaultTools()` by `.defaultToolCallbacks()` for registering MCP tools. Signed-off-by: Christian Tzolov <[email protected]>
1 parent 39478da commit dc4fda9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/quickstart/client.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,17 +919,22 @@ The chatbot is implemented using Spring AI's ChatClient with MCP tool integratio
919919
```java
920920
var chatClient = chatClientBuilder
921921
.defaultSystem("You are useful assistant, expert in AI and Java.")
922-
.defaultTools((Object[]) mcpToolAdapter.toolCallbacks())
922+
.defaultToolCallbacks((Object[]) mcpToolAdapter.toolCallbacks())
923923
.defaultAdvisors(new MessageChatMemoryAdvisor(new InMemoryChatMemory()))
924924
.build();
925925
```
926926

927+
<Warning>
928+
Breaking change: From SpringAI 1.0.0-M8 onwards, use `.defaultToolCallbacks(...)` instead of `.defaultTool(...)` to register MCP tools.
929+
</Warning>
930+
927931
Key features:
928932
- Uses Claude AI model for natural language understanding
929933
- Integrates Brave Search through MCP for real-time web search capabilities
930934
- Maintains conversation memory using InMemoryChatMemory
931935
- Runs as an interactive command-line application
932936

937+
933938
### Build and run
934939

935940
```bash

0 commit comments

Comments
 (0)