feat(anthropic): support mcp_toolset in bind_tools (#34284)

This commit is contained in:
ccurme
2025-12-10 09:39:35 -05:00
committed by GitHub
parent 7542278997
commit 5350967ddc
3 changed files with 2 additions and 4 deletions

View File

@@ -154,6 +154,7 @@ def _is_builtin_tool(tool: Any) -> bool:
"web_search_", "web_search_",
"web_fetch_", "web_fetch_",
"code_execution_", "code_execution_",
"mcp_toolset",
"memory_", "memory_",
"tool_search_", "tool_search_",
] ]

View File

@@ -1801,18 +1801,15 @@ def test_remote_mcp(output_version: Literal["v0", "v1"]) -> None:
"type": "url", "type": "url",
"url": "https://mcp.deepwiki.com/mcp", "url": "https://mcp.deepwiki.com/mcp",
"name": "deepwiki", "name": "deepwiki",
"tool_configuration": {"enabled": True, "allowed_tools": ["ask_question"]},
"authorization_token": "PLACEHOLDER", "authorization_token": "PLACEHOLDER",
}, },
] ]
llm = ChatAnthropic( llm = ChatAnthropic(
model="claude-sonnet-4-5-20250929", # type: ignore[call-arg] model="claude-sonnet-4-5-20250929", # type: ignore[call-arg]
betas=["mcp-client-2025-04-04"],
mcp_servers=mcp_servers, mcp_servers=mcp_servers,
max_tokens=10_000, # type: ignore[call-arg]
output_version=output_version, output_version=output_version,
) ).bind_tools([{"type": "mcp_toolset", "mcp_server_name": "deepwiki"}])
input_message = { input_message = {
"role": "user", "role": "user",