【求助】Claude code中GLM-5调用tool报400错误

2026-04-11 14:581阅读0评论SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐
问题描述:

用的京东云的Coding Plan Lite,GLM-5可以使用,但是只要用到tool就报错中断,只调用cc内置的tool都会报错,用CC Switch切到Claude或者GPT都是能正常调用的。


⎿ API Error: 400 {"error":{"cause":"","code":400,"message":"{\"code\":400,\"message\":\"51 validation errors:\\n {'type': 'string_type', 'loc': ('body', 'messages', 3, 'ChatCompletionMessageGenericParam', 'content', 'str'), 'msg': 'Input should be a valid string', 'input': [{'tool_name': 'mcp__plugin_claude-mem_mcp-search____IMPORTANT', 'type': 'tool_reference'}, {'tool_name': 'mcp__plugin_claude-mem_mcp-search__get_observations', 'type': 'tool_reference'}, {'tool_name': 'mcp__plugin_claude-mem_mcp-search__search', 'type': 'tool_reference'}]}\\n {'type': 'literal_error', 'loc': ('body', 'messages', 3, 'ChatCompletionMessageGenericParam', 'content', 'list[union[ChatCompletionMessageContentTextPart,ChatCompletionMessageContentImagePart,ChatCompletionMessageContentVideoPart,ChatCompletionMessageContentAudioPart]]', 0, 'ChatCompletionMessageContentTextPart', 'type'), 'msg': \\\"Input should be 'text'\\\", 'input': 'tool_reference', 'ctx': {'expected': \\\"'text'\\\"}}\\n {'type': 'missing', 'loc': ('body', 'messages', 3, 'ChatCompletionMessageGenericParam', 'content', 网友解答:


--【壹】--:

应该是LLM提供商那边不支持tool_reference这个tool type


--【贰】--:

这是啥原理啊 我现在每次升级都还在用论坛里佬友的py补丁


--【叁】--:

把tool search关了试试看


--【肆】--:

0ac18671fba696bcdbcd8fc9d1e02979696×691 48.7 KB


--【伍】--:

确实好了,本来都想退款了

问题描述:

用的京东云的Coding Plan Lite,GLM-5可以使用,但是只要用到tool就报错中断,只调用cc内置的tool都会报错,用CC Switch切到Claude或者GPT都是能正常调用的。


⎿ API Error: 400 {"error":{"cause":"","code":400,"message":"{\"code\":400,\"message\":\"51 validation errors:\\n {'type': 'string_type', 'loc': ('body', 'messages', 3, 'ChatCompletionMessageGenericParam', 'content', 'str'), 'msg': 'Input should be a valid string', 'input': [{'tool_name': 'mcp__plugin_claude-mem_mcp-search____IMPORTANT', 'type': 'tool_reference'}, {'tool_name': 'mcp__plugin_claude-mem_mcp-search__get_observations', 'type': 'tool_reference'}, {'tool_name': 'mcp__plugin_claude-mem_mcp-search__search', 'type': 'tool_reference'}]}\\n {'type': 'literal_error', 'loc': ('body', 'messages', 3, 'ChatCompletionMessageGenericParam', 'content', 'list[union[ChatCompletionMessageContentTextPart,ChatCompletionMessageContentImagePart,ChatCompletionMessageContentVideoPart,ChatCompletionMessageContentAudioPart]]', 0, 'ChatCompletionMessageContentTextPart', 'type'), 'msg': \\\"Input should be 'text'\\\", 'input': 'tool_reference', 'ctx': {'expected': \\\"'text'\\\"}}\\n {'type': 'missing', 'loc': ('body', 'messages', 3, 'ChatCompletionMessageGenericParam', 'content', 网友解答:


--【壹】--:

应该是LLM提供商那边不支持tool_reference这个tool type


--【贰】--:

这是啥原理啊 我现在每次升级都还在用论坛里佬友的py补丁


--【叁】--:

把tool search关了试试看


--【肆】--:

0ac18671fba696bcdbcd8fc9d1e02979696×691 48.7 KB


--【伍】--:

确实好了,本来都想退款了