1 parent 21984f2 commit 24678dfCopy full SHA for 24678df
1 file changed
python_agent_harness/agent.py
@@ -319,6 +319,16 @@ def _execute_tool_call(self, call: ToolCall) -> str:
319
args = {}
320
if not isinstance(args, dict):
321
322
+ # Validate required parameters from the tool schema
323
+ tool = self.session.registry.get(call.name)
324
+ if tool is not None:
325
+ required = tool.parameters.get("required", [])
326
+ missing = [k for k in required if k not in args]
327
+ if missing:
328
+ return (
329
+ f"Error: {call.name} is missing required argument(s): "
330
+ f"{', '.join(missing)}"
331
+ )
332
return self.session.execute_tool(call.name, args, call_id=call.id)
333
334
def _deliver_tool_result(self, p: ToolCall, result: str) -> None:
0 commit comments