Fix/mcp tool missing parameters #478
Open
+158
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The ToolParamOfMcp function was missing critical parameters (allowed_tools and require_approval) that are required for proper MCP integration according to OpenAI's documentation.
This is a breaking change that adds two new required parameters:
Without these parameters, MCP integration fails even though tool discovery works. The function now properly populates the ToolMcpParam struct fields that were already available but not being set.
Breaking Change: Function signature changed from:
ToolParamOfMcp(serverLabel, serverURL string)
To:
ToolParamOfMcp(serverLabel, serverURL string, allowedTools []string, requireApproval string)
Fixes MCP tool execution issues where requests would fail with 500 errors or never reach the MCP server despite successful tool discovery.
Without this fix MCP calls through Responses API will freeze at this stage (awaiting approval I guess) and OpenAI response to client will be empty:

With this fix applied, everything works as it should:
