AI Agent Hub
Back to plugins
🤖

dsh-tool-quota

Model Inference Updated 2026.09.01

Run the following command in DeepSeek Harness:

dsh plugin install jwilson411/dsh-tool-quota

Paste the following prompt into your AI chat to install this plugin:

Run dsh plugin install jwilson411/dsh-tool-quota in DeepSeek Harness to install this plugin; full source is at https://github.com/jwilson411/dsh-tool-quota.

About this plugin

When an agent is handed a search tool, each individual call is perfectly legal. That does nothing to stop it from firing off eighty queries in a single session or pulling back a four-megabyte page and dumping the whole thing into the conversation. dsh-tool-quota closes that gap by enforcing hard caps on both call count and result byte size, scoped per tool and per session.

Two design choices stand out. First, over-quota results are discarded outright rather than truncated: the call fails with a machine-readable code (TOOL_QUOTA_CALLS or TOOL_QUOTA_BYTES), so a caller can branch on the error without parsing prose. Second, the quota is a session-level total, not a rate limiter: there is no time window, no sleep-and-retry, and the allowance does not refill until the session ends or the plugin is reloaded. The plugin also registers a tool_quota_status tool that lets an agent proactively check the remaining allowance for every configured tool, removing the need to discover the cap by hitting it.

It fits developers deploying multi-tool agent workflows who need to prevent any single tool from being over-invoked. The plugin deliberately does not handle spend budgets, token accounting, or permission gating. It does one thing: give every tool a clear per-session usage ceiling and a clear, coded signal when that ceiling is crossed.

Use Cases

  • Stop an agent from firing off dozens of search calls or pulling multi-megabyte results that flood the conversation context
  • Isolate per-session call allowances so multiple agents sharing a tool do not exhaust each other's quota
  • Set a hard byte ceiling on tool results so oversized payloads are discarded rather than silently truncated into the context window

Best For

  • Engineers running multi-tool agent workflows who need to prevent any single tool from being over-invoked
  • Security or platform teams that require clear usage boundaries and machine-readable error codes when limits are exceeded
  • Application developers who want agents to proactively check remaining allowance instead of discovering caps by hitting them