The API says a function parameter schema is invalid or missing properties.
Why this happens
Function-tool parameters must be a valid JSON Schema object. For a tool that expects arguments, declare its accepted fields, types, and required properties. An empty object schema can describe a no-argument tool, so check the exact validation error and the API format before changing it.
Answer 1: Supply a complete JSON Schema
tools = [{
"type": "function",
"name": "get_weather",
"description": "Get the current weather for a location.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City and country, for example Pune, India",
},
},
"required": ["location"],
"additionalProperties": False,
},
}]
Validate the schema locally in tests before sending it.
