Is there an existing issue for this?
Current Behavior
Coder Agent chats using an OpenAI/GPT-backed model fail before tool execution when an MCP server exposes a zero-argument tool.
The tool used to reproduce this is Tidewave's get_ecto_schemas. Its MCP schema is valid and includes an explicit empty object:
{
"type": "object",
"properties": {}
}
In a GPT-backed Coder chat, attempting to use that tool fails with HTTP 400. In a Sonnet-backed chat connected to the same workspace and MCP endpoint, the tool executes successfully and returns the expected schema list. MCP tools with non-empty parameter schemas also work on both providers.
This appears to be the object-valued counterpart of #23538: an empty or nil properties map reaches the OpenAI function schema as "properties": null rather than "properties": {}. The current MCP wrapper passes tool.InputSchema.Properties through as fantasy.ToolInfo.Parameters; that path likely needs the same defensive normalization previously added for required.
Relevant Log Output
OpenAI returned an unexpected error.
Invalid schema for function 'tidewave__get_ecto_schemas': None is not of type 'object'.
HTTP 400
Expected Behavior
Parameter-free MCP tools should be accepted by OpenAI-backed chats. Coder should preserve or normalize their function parameter schema to an explicit empty object, for example:
{
"type": "object",
"properties": {},
"required": []
}
At the provider boundary, object schemas with missing, nil, or null properties should likewise be normalized to {}.
Steps to Reproduce
- Configure a Streamable HTTP MCP server in Coder that exposes a zero-argument tool with
inputSchema: {"type":"object","properties":{}}.
- Create a Coder Agent chat using an OpenAI/GPT-backed model.
- Ask the agent to invoke the zero-argument tool.
- Observe the OpenAI HTTP 400 before the MCP tool executes.
- Switch to a Sonnet-backed model and invoke the same tool; it succeeds.
Environment
- Host OS: self-hosted Linux deployment
- Coder server:
v2.35.2+5c2838a
- Coder client:
v2.33.1+3e34ba7
- MCP transport: Streamable HTTP
- Affected provider: OpenAI/GPT
- Unaffected provider: Anthropic/Sonnet
- Reproduces consistently: yes
Additional Context
Is there an existing issue for this?
Current Behavior
Coder Agent chats using an OpenAI/GPT-backed model fail before tool execution when an MCP server exposes a zero-argument tool.
The tool used to reproduce this is Tidewave's
get_ecto_schemas. Its MCP schema is valid and includes an explicit empty object:{ "type": "object", "properties": {} }In a GPT-backed Coder chat, attempting to use that tool fails with HTTP 400. In a Sonnet-backed chat connected to the same workspace and MCP endpoint, the tool executes successfully and returns the expected schema list. MCP tools with non-empty parameter schemas also work on both providers.
This appears to be the object-valued counterpart of #23538: an empty or nil properties map reaches the OpenAI function schema as
"properties": nullrather than"properties": {}. The current MCP wrapper passestool.InputSchema.Propertiesthrough asfantasy.ToolInfo.Parameters; that path likely needs the same defensive normalization previously added forrequired.Relevant Log Output
Expected Behavior
Parameter-free MCP tools should be accepted by OpenAI-backed chats. Coder should preserve or normalize their function parameter schema to an explicit empty object, for example:
{ "type": "object", "properties": {}, "required": [] }At the provider boundary, object schemas with missing, nil, or null
propertiesshould likewise be normalized to{}.Steps to Reproduce
inputSchema: {"type":"object","properties":{}}.Environment
v2.35.2+5c2838av2.33.1+3e34ba7Additional Context
properties: {}, notnull.{}.propertiesfield openai/openai-agents-python#449.