v2 switch client examples to .callTool usage (#1628)
This commit is contained in:
parent
1fe9eda4a7
commit
4663a26f2a
1 changed files with 51 additions and 109 deletions
|
|
@ -1,6 +1,6 @@
|
|||
//#region prelude
|
||||
import Anthropic from '@anthropic-ai/sdk';
|
||||
import { Client, StdioClientTransport, type CallToolResult } from '@modelcontextprotocol/client';
|
||||
import { Client, StdioClientTransport } from '@modelcontextprotocol/client';
|
||||
import readline from 'readline/promises';
|
||||
|
||||
const ANTHROPIC_MODEL = 'claude-sonnet-4-5';
|
||||
|
|
@ -84,7 +84,7 @@ class MCPClient {
|
|||
const result = await this.mcp.callTool({
|
||||
name: toolName,
|
||||
arguments: toolArgs,
|
||||
}) as CallToolResult;
|
||||
});
|
||||
|
||||
finalText.push(`[Calling tool ${toolName} with args ${JSON.stringify(toolArgs)}]`);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue