Merge pull request #106 from wxhzzsf/wxh/qeury-anthropic-native-mcp-input-schema-fix

fix: add mcp support for anthropic native tool input schema
This commit is contained in:
Xinlu Lai 2025-10-07 13:48:52 +08:00 committed by GitHub
commit 1b3b0786ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1434,7 +1434,9 @@ async function queryAnthropicNative(
description: typeof tool.description === 'function'
? await tool.description()
: tool.description,
input_schema: zodToJsonSchema(tool.inputSchema),
input_schema:'inputJSONSchema' in tool && tool.inputJSONSchema
? tool.inputJSONSchema
: zodToJsonSchema(tool.inputSchema),
}) as unknown as Anthropic.Beta.Messages.BetaTool,
)
)