-
-
Notifications
You must be signed in to change notification settings - Fork 930
Description
Project Version
9.8.2
Bug Description
Symptom: When calling the listmodels tool through modern AI agents (like Claude Code or Gemini), the tool fails with a schema validation error and returns no results. Error Message: Input validation error: Additional properties are not allowed ('reason' was unexpected).
Root Cause: Many AI agents automatically inject a reason parameter into tool calls to provide context for the action. However, the ListModelsTool has a strictly defined input schema in tools/listmodels.py:
def get_input_schema(self) -> dict[str, Any]:
return {
"type": "object",
"properties": {},
"required": [],
"additionalProperties": False, # This caused the failure
}Because additionalProperties is set to False, the injection of the reason field (or any other metadata from the agent) causes the entire tool execution to be rejected before it even runs.
Expected Behavior: The tool should ignore unexpected top-level properties like reason to maintain compatibility with various AI agent implementations, or explicitly allow additionalProperties.
Suggested Fix: Change "additionalProperties": False to True in tools/listmodels.py.
Relevant Log Output
Operating System
macOS
Sanity Checks
- I have searched the existing issues and this is not a duplicate.
- I am using
GEMINI_API_KEY - I am using
OPENAI_API_KEY - I am using
OPENROUTER_API_KEY - I am using
CUSTOM_API_URL