Skip to content

Conversation

@roomote
Copy link
Collaborator

@roomote roomote commented Jun 19, 2025

  • Modified formatResponse.noToolsUsed() and formatResponse.missingToolParameterError() to accept optional hasMcpTools parameter
  • Added getToolUseInstructionsReminder() function that provides correct syntax based on tool type
  • When MCP tools are available, shows proper use_mcp_tool format instead of generic XML format
  • Added hasMcpToolsAvailable() method to Task class to detect when MCP servers with tools are connected
  • Updated all call sites to pass MCP tool availability information
  • Maintains backward compatibility with legacy toolUseInstructionsReminder constant

This prevents the infinite loop where AI tries wrong MCP syntax and gets corrected with wrong format.


Important

Fixes incorrect MCP tool syntax reminders by introducing a new function to provide correct instructions based on tool availability.

  • Behavior:
    • formatResponse.noToolsUsed() and formatResponse.missingToolParameterError() now accept hasMcpTools parameter to determine tool syntax.
    • Introduces getToolUseInstructionsReminder() to provide correct syntax based on tool type.
    • Displays use_mcp_tool format when MCP tools are available, otherwise defaults to XML format.
  • Task Class:
    • Adds hasMcpToolsAvailable() method to check MCP tool availability.
    • Updates call sites to pass MCP tool availability to response functions.
  • Misc:
    • Maintains backward compatibility with toolUseInstructionsReminder constant.

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

- Modified formatResponse.noToolsUsed() and formatResponse.missingToolParameterError() to accept optional hasMcpTools parameter
- Added getToolUseInstructionsReminder() function that provides correct syntax based on tool type
- When MCP tools are available, shows proper use_mcp_tool format instead of generic XML format
- Added hasMcpToolsAvailable() method to Task class to detect when MCP servers with tools are connected
- Updated all call sites to pass MCP tool availability information
- Maintains backward compatibility with legacy toolUseInstructionsReminder constant

This prevents the infinite loop where AI tries wrong MCP syntax and gets corrected with wrong format.
@roomote roomote requested review from cte, jr and mrubens as code owners June 19, 2025 21:23
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Jun 19, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 19, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Jun 19, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jun 20, 2025
@daniel-lxs
Copy link
Member

This PR would cause Roo Code to return instructions on how to use MCP tools when the model fails to use any tool, not just MCP tools.

Since it's difficult to determine intent, we can't tell what tool the LLM is trying to use. If we assume that the model is trying to use MCP tools when it doesn't use any tool correctly, we might end up confusing the model even more.

A better solution for this issue might involve normalizing our MCP tool call schema to use XML or adding a reminder to the "No tools used" message specifically for MCP tools, though that might also confuse the model.

Closing for now.

@daniel-lxs daniel-lxs closed this Jun 22, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Prelim Review] to Done in Roo Code Roadmap Jun 22, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 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 PR - Needs Preliminary Review size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants