• AgentArmorHQ teamTeam4d agoNeeds helpSolved

    Roo-Code XML tool calls fail ~10%: is there native tool calling for Claude?

    Roo-Code currently makes models call tools via XML tags, and users report roughly 10% tool-call failures with top-tier models, over 15% for apply_diff, and worse reliability in multi-turn agent modes. Is native OpenAI/Anthropic-style tool calling implemented, or is there a working branch to try? Nothing here depends on OS or editor client; it is about the Roo-Code engine.

    Originally asked on GitHub: https://github.com/RooCodeInc/Roo-Code/issues/4047

    6 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Status: still not implemented officially. The RFC proposing native tool calling was closed as NOT_PLANNED, and a collaborator said the maintainers would want evaluation evidence of the benefit before committing.

      Community contributor moqimoqidea pursued an experimental implementation instead:

      • First attempt (PR "Attempt to use the unique tools for Claude Sonnet 4 V1"): give Claude Sonnet 4 dedicated tools integrated into the existing context flow. It was abandoned because XML instructions appear throughout the system prompt (e.g. "Formulate your tool use using the XML format specified for each tool"), making full separation hard.
      • Second attempt (PR "Attempt to use the unique tools for Claude Sonnet 4 V2"): keep Claude Sonnet 4 tools independent from the main workflow, using a separate system prompt file and a custom parseAnthropicAssistantMessage parser. Still under development when discussed.
      • Working branch: dev-3.22.5-prompt-v2, based on Roo-Code v3.22.5, routes Claude Sonnet 4 through native Anthropic tool use with a transparent middleware layer converting between Anthropic tool-use JSON and Roo-Code XML tools. Only read_file and attempt_completion had been tested at the time; the rest were pending.

      A user also asked that any native-calling feature remain optional (e.g. a settings checkbox), because vLLM had open issues with native tool calling for models like Mistral and Qwen. They noted Roo-Code worked with Devstral and Qwen precisely because it uses XML rather than the provider's native tool format.

      If you are on v3.22.5 and want to experiment, that contributor branch is the most concrete option. It comes with the usual caveat: it was a work-in-progress community effort, not an official supported release.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @moqimoqidea tried on GitHub (Partly worked)

      Built the dev-3.22.5-prompt-v2 branch based on Roo-Code v3.22.5, routing Claude Sonnet 4 through native Anthropic tool use with a transparent middleware layer; read_file and attempt_completion were tested, other tools still under testing.

      Source: https://github.com/RooCodeInc/Roo-Code/issues/4047#issuecomment-3055155505 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @moqimoqidea tried on GitHub (Partly worked)

      Second MVP attempt on v3.22.5 gave Claude Sonnet 4 a separate tool list and a custom parseAnthropicAssistantMessage parser to bypass XML prompts embedded in the normal flow; still in development when reported.

      Source: https://github.com/RooCodeInc/Roo-Code/issues/4047#issuecomment-3047201636 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @moqimoqidea tried on GitHub (Outcome unclear)

      Planned an MVP: remove apply_diff XML instructions from the Claude Sonnet 4 system prompt, add Claude str_replace, and update retry logic, starting from a stable tag like v3.19.3; only planned, not implemented yet.

      Source: https://github.com/RooCodeInc/Roo-Code/issues/4047#issuecomment-2942688339 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @slg95 tried on GitHub (Worked)

      Used Roo-Code with Devstral and Qwen under vLLM using XML tool calling, because vLLM had open issues with native tool calling for those models; XML calling worked for this user, who asked that native calling remain optional via a settings checkbox.

      Source: https://github.com/RooCodeInc/Roo-Code/issues/4047#issuecomment-3084129262 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Outcome unclear)

      Proposed a tiered architecture (provider/model detection, native tool routing for Claude/OpenAI/Gemini, XML as fallback) with translation of apply_diff to Claude's str_replace; this was the feature request itself and was closed as NOT_PLANNED.

      Source: https://github.com/RooCodeInc/Roo-Code/issues/4047 (opens external site)

      Did this work for you?

    Add your answer or comment