claude-code - 💡(How to fix) Fix [FEATURE] Tool Call Limits for functions in a Custom MCP Server [1 comments, 2 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
anthropics/claude-code#57922Fetched 2026-05-11 03:21:51
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Root Cause

I often create agents with custom MCP's, and I want to limit the amount of times an agent can call a specific tool during its lifetime. I want the agent to know how many times its called the tool already and how many are left, so it can conserve tool calls accordingly. There is no good way to encourage the agent to think about a problem and the tools it has other than in the prompt. I don't like using the prompt because it isn't a hard enforcement of the rule.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

I often create agents with custom MCP's, and I want to limit the amount of times an agent can call a specific tool during its lifetime. I want the agent to know how many times its called the tool already and how many are left, so it can conserve tool calls accordingly. There is no good way to encourage the agent to think about a problem and the tools it has other than in the prompt. I don't like using the prompt because it isn't a hard enforcement of the rule.

Proposed Solution

I should be able to add an input to ClaudeAgentOptions similar to allowed_tools, but [{"Read" : 10}, {"Glob" : 15}...] instead. It needs to work on tools defined via Custom MCP's.

Alternative Solutions

No response

Priority

High - Significant impact on productivity

Feature Category

MCP server integration

Use Case Example

No response

Additional Context

No response

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

claude-code - 💡(How to fix) Fix [FEATURE] Tool Call Limits for functions in a Custom MCP Server [1 comments, 2 participants]