OpenAI Agents SDK calls OpenAI API with invalid schema when MCP tool definitions have no properties
field
#449
Labels
bug
Something isn't working
Describe the bug
When using the OpenAI Agents SDK with an MCP-compatible server, defining a tool without the
properties
field in theinputSchema
causes the SDK to invoke OpenAI's API with invalid parameters, resulting in a schema validation error from the API.OpenAI's API expects the
properties
field to be present, whereas the MCP schema explicitly allows omitting theproperties
field. MCP SpecThe SDK should bridge this gap by adding an empty
properties
object{}
if not provided.Debug information
Repro steps
Create an MCP server tool definition without a
properties
field, for example:Call this tool via the OpenAI Agents SDK, causing the following error from OpenAI's API:
Expected behavior
The SDK should automatically inject an empty
properties
object{}
in the OpenAI API call to remain compatible with OpenAI's expected schema, bridging the difference between the MCP schema and OpenAI's API requirements.The text was updated successfully, but these errors were encountered: