openclaw - 💡(How to fix) Fix Plugin tools rejected by API due to claude-code-20250219 beta header [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#60467Fetched 2026-04-08 02:50:49
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

Error Message

  1. Error: "No such tool available: <tool_name>"
  • Error string "No such tool available" appears in @anthropic-ai/claude-code/cli.js, NOT in OpenClaw's bundle or the Pi SDK

Root Cause

The Pi SDK sends claude-code-20250219 in the beta header (via PI_AI_OAUTH_ANTHROPIC_BETAS). This causes the Anthropic API to enforce Claude Code's built-in tool whitelist. Any tool not in the canonical Claude Code set (Read, Write, Bash, Edit, Grep, Glob, etc.) is rejected.

Plugin tools pass through toClaudeCodeName() unchanged (since they're not in the lookup table), but the API only accepts tools it recognizes as Claude Code built-ins.

RAW_BUFFERClick to expand / collapse

Bug

Custom tools registered via api.registerTool() in plugins are listed in the system prompt and sent in the API request's tools array, but tool execution is rejected server-side with "No such tool available."

Root Cause

The Pi SDK sends claude-code-20250219 in the beta header (via PI_AI_OAUTH_ANTHROPIC_BETAS). This causes the Anthropic API to enforce Claude Code's built-in tool whitelist. Any tool not in the canonical Claude Code set (Read, Write, Bash, Edit, Grep, Glob, etc.) is rejected.

Plugin tools pass through toClaudeCodeName() unchanged (since they're not in the lookup table), but the API only accepts tools it recognizes as Claude Code built-ins.

Steps to Reproduce

  1. Create a plugin that registers a custom tool via api.registerTool()
  2. Configure alsoAllow in the profile to pass policy filtering
  3. Start a session — the tool appears in "Tool availability" in the system prompt
  4. Ask the model to use the tool
  5. Error: "No such tool available: <tool_name>"

Evidence

  • Error string "No such tool available" appears in @anthropic-ai/claude-code/cli.js, NOT in OpenClaw's bundle or the Pi SDK
  • Pi SDK's equivalent would be "Tool X not found" — different string
  • convertTools() in pi-ai/providers/anthropic.js DOES include plugin tools in the request
  • The claude-code-20250219 beta header is always sent when using OAuth credentials

Impact

ALL plugins that register custom tools are affected. This makes the plugin tool registration API non-functional.

Possible Fixes

  1. Don't send claude-code-20250219 when custom plugin tools are present
  2. Intercept plugin tool calls locally before API validation
  3. Register plugin tools with the API in a beta-compatible way

Environment

  • OpenClaw 1.6.10
  • Node 22.22.1
  • Linux

extent analysis

TL;DR

Modify the Pi SDK to conditionally exclude the claude-code-20250219 beta header when custom plugin tools are registered.

Guidance

  • Identify the code path in the Pi SDK where the claude-code-20250219 beta header is added and modify it to check for the presence of custom plugin tools.
  • Consider implementing a workaround to intercept plugin tool calls locally before API validation to bypass the built-in tool whitelist enforcement.
  • Review the convertTools() function in pi-ai/providers/anthropic.js to ensure it correctly handles plugin tools in the request.
  • Investigate registering plugin tools with the API in a beta-compatible way as a potential long-term solution.

Example

// Example of conditionally excluding the beta header
if (customPluginToolsPresent) {
  delete headers['PI_AI_OAUTH_ANTHROPIC_BETAS'];
}

Notes

The provided solution assumes that the claude-code-20250219 beta header is the primary cause of the issue. However, further investigation may be necessary to ensure that this modification does not introduce other compatibility issues.

Recommendation

Apply a workaround to conditionally exclude the claude-code-20250219 beta header when custom plugin tools are registered, as this appears to be the most direct solution to the problem.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Plugin tools rejected by API due to claude-code-20250219 beta header [1 participants]