diff --git a/mini_agent/agent.py b/mini_agent/agent.py index b7d7feab..c84ba882 100644 --- a/mini_agent/agent.py +++ b/mini_agent/agent.py @@ -460,7 +460,10 @@ async def run(self, cancel_event: Optional[asyncio.Event] = None) -> str: else: try: tool = self.tools[function_name] - result = await tool.execute(**arguments) + # Filter arguments to only include parameters defined in tool schema + valid_params = tool.parameters.get('properties', {}).keys() + filtered_args = {k: v for k, v in arguments.items() if k in valid_params} + result = await tool.execute(**filtered_args) except Exception as e: # Catch all exceptions during tool execution, convert to failed ToolResult import traceback