Skip to content

Ensure MCP works when inputSchema.properties is missing#454

Merged
rm-openai merged 1 commit intomainfrom
rm/pr454
Apr 7, 2025
Merged

Ensure MCP works when inputSchema.properties is missing#454
rm-openai merged 1 commit intomainfrom
rm/pr454

Conversation

@rm-openai
Copy link
Collaborator

@rm-openai rm-openai commented Apr 7, 2025

Resolves #449 - TLDR, OpenAI's API expects the properties field to be present, whereas the MCP schema explicitly allows omitting the properties field. MCP Spec

@rm-openai rm-openai merged commit 50bbfdd into main Apr 7, 2025
10 checks passed
@rm-openai rm-openai deleted the rm/pr454 branch April 7, 2025 22:38
onmete added a commit to onmete/lightspeed-service that referenced this pull request Feb 13, 2026
MCP tools that accept no arguments (e.g. configuration_contexts_list
from openshift-mcp-server) produce an inputSchema of {"type": "object"}
without a "properties" key. This is valid per JSON Schema and the MCP
spec, but causes two failures:

1. LangChain's BaseTool.args does json_schema["properties"] → KeyError
2. OpenAI API rejects the function with "object schema missing properties"

Normalize tool schemas after loading from MCP servers by injecting an
empty "properties": {} when the key is missing. This matches the fix
applied in openai/openai-agents-python#454 for the same issue.

Co-authored-by: Cursor <cursoragent@cursor.com>
onmete added a commit to onmete/lightspeed-service that referenced this pull request Feb 26, 2026
MCP tools that accept no arguments (e.g. configuration_contexts_list
from openshift-mcp-server) produce an inputSchema of {"type": "object"}
without a "properties" key. This is valid per JSON Schema and the MCP
spec, but causes two failures:

1. LangChain's BaseTool.args does json_schema["properties"] → KeyError
2. OpenAI API rejects the function with "object schema missing properties"

Normalize tool schemas after loading from MCP servers by injecting an
empty "properties": {} when the key is missing. This matches the fix
applied in openai/openai-agents-python#454 for the same issue.

Co-authored-by: Cursor <cursoragent@cursor.com>
onmete added a commit to onmete/lightspeed-service that referenced this pull request Feb 26, 2026
MCP tools that accept no arguments (e.g. configuration_contexts_list
from openshift-mcp-server) produce an inputSchema of {"type": "object"}
without a "properties" key. This is valid per JSON Schema and the MCP
spec, but causes two failures:

1. LangChain's BaseTool.args does json_schema["properties"] → KeyError
2. OpenAI API rejects the function with "object schema missing properties"

Normalize tool schemas after loading from MCP servers by injecting an
empty "properties": {} when the key is missing. This matches the fix
applied in openai/openai-agents-python#454 for the same issue.

Co-authored-by: Cursor <cursoragent@cursor.com>
Made-with: Cursor
onmete added a commit to onmete/lightspeed-service that referenced this pull request Feb 26, 2026
MCP tools that accept no arguments (e.g. configuration_contexts_list
from openshift-mcp-server) produce an inputSchema of {"type": "object"}
without a "properties" key. This is valid per JSON Schema and the MCP
spec, but causes two failures:

1. LangChain's BaseTool.args does json_schema["properties"] → KeyError
2. OpenAI API rejects the function with "object schema missing properties"

Normalize tool schemas after loading from MCP servers by injecting an
empty "properties": {} when the key is missing. This matches the fix
applied in openai/openai-agents-python#454 for the same issue.

Co-authored-by: Cursor <cursoragent@cursor.com>
Made-with: Cursor
sriroopar pushed a commit to sriroopar/lightspeed-service that referenced this pull request Mar 2, 2026
MCP tools that accept no arguments (e.g. configuration_contexts_list
from openshift-mcp-server) produce an inputSchema of {"type": "object"}
without a "properties" key. This is valid per JSON Schema and the MCP
spec, but causes two failures:

1. LangChain's BaseTool.args does json_schema["properties"] → KeyError
2. OpenAI API rejects the function with "object schema missing properties"

Normalize tool schemas after loading from MCP servers by injecting an
empty "properties": {} when the key is missing. This matches the fix
applied in openai/openai-agents-python#454 for the same issue.

Co-authored-by: Cursor <cursoragent@cursor.com>
Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAI Agents SDK calls OpenAI API with invalid schema when MCP tool definitions have no properties field

2 participants