Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Dec 19, 2025

Summary

MCP tools (like Linear's MCP server) have optional parameters that were broken by OpenAI's strict mode which requires ALL properties to be in the required array.

Changes

  • Check if tool name starts with mcp-- prefix (indicating MCP tool)
  • Set strict: false for MCP tools
  • Preserve original schema without forcing all properties to required
  • Keep strict mode for Roo's native tools which are designed for it

Files Changed

  • src/api/providers/base-provider.ts - convertToolsForOpenAI()
  • src/api/providers/openai-native.ts - buildRequestBody()

Testing

  • All existing tests pass (38/38 openai-native, 10/10 mcp_server)
  • TypeScript compilation passes

Fixes ROO-241


Important

Disable strict mode for MCP tools by checking for mcp-- prefix, preserving optional parameters while maintaining strict mode for native tools.

  • Behavior:
    • Disable strict mode for MCP tools by checking for mcp-- prefix in convertToolsForOpenAI() in base-provider.ts and buildRequestBody() in openai-native.ts.
    • Preserve optional parameters for MCP tools, while keeping strict mode for native tools.
  • Utilities:
    • Add isMcpTool() function in mcp-name.ts to identify MCP tools by prefix.
  • Testing:
    • Add tests for isMcpTool() in mcp-name.spec.ts.
    • All existing tests pass.

This description was created by Ellipsis for 7b0985a. You can customize this summary. It will automatically update as commits are pushed.

MCP tools (like Linear's MCP server) have optional parameters that were broken
by OpenAI's strict mode which requires ALL properties to be in the required array.

This change:
- Checks if tool name starts with 'mcp--' prefix
- Sets strict: false for MCP tools
- Preserves original schema without forcing all properties to required

Fixes ROO-241
@roomote
Copy link
Contributor

roomote bot commented Dec 19, 2025

Rooviewer Clock   See task on Roo Cloud

Review completed. No issues found.

The refactoring correctly replaces the hardcoded "mcp--" prefix with a centralized isMcpTool helper function that uses the MCP_TOOL_PREFIX and MCP_TOOL_SEPARATOR constants. This addresses the feedback from the previous review and improves maintainability.

Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Dec 19, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 19, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Dec 22, 2025
@hannesrudolph hannesrudolph added PR - Needs Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Dec 22, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 22, 2025
@daniel-lxs daniel-lxs merged commit 6b141fb into main Dec 22, 2025
13 checks passed
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Dec 22, 2025
@daniel-lxs daniel-lxs deleted the dan/roo-241 branch December 22, 2025 18:21
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer PR - Needs Review size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants