Skip to content

fix: filter tool arguments to match schema parameters#89

Open
gaoyi1020-web wants to merge 1 commit intoMiniMax-AI:mainfrom
gaoyi1020-web:fix/filter-tool-arguments
Open

fix: filter tool arguments to match schema parameters#89
gaoyi1020-web wants to merge 1 commit intoMiniMax-AI:mainfrom
gaoyi1020-web:fix/filter-tool-arguments

Conversation

@gaoyi1020-web
Copy link
Copy Markdown

Summary

  • Filter LLM-returned tool arguments to only include parameters defined in the tool's schema
  • Fixes TypeError: BashTool.execute() got an unexpected keyword argument 'description'

Problem

When the LLM returns tool call arguments, it may include extra parameters (e.g., description) that are not accepted by tool.execute(). This causes TypeError and breaks tool execution.

Solution

Filter arguments against tool.parameters['properties'].keys() before passing to execute().

Test plan

  • Manual test: mini-agent --task "用 python 写一个 hello world" - works correctly

🤖 Generated with Claude Code

LLM may return extra parameters (e.g., 'description') that are not
accepted by tool.execute(). Filter arguments to only include parameters
defined in the tool's schema.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant