tbcontracts-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| TBCONTRACTS_MCP_OTEL | No | Set to '1' to enable OpenTelemetry spans from the underlying token-budget-contracts library. Uses the global OTel tracer provider; configure your exporter separately. | 0 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| register_agentA | Register a new agent in the budget system with a priority weight and an initial token budget. Call this once per agent before recording spend or requesting reallocation for it. Priority is relative: higher priority agents can pull spare budget from equal-or-lower priority agents during reallocation, but budget never flows from a higher-priority agent to a lower-priority one. Re-registering an existing agent_id resets its contract and ledger entry. |
| record_spendA | Record tokens actually consumed by a registered agent for a task, as raw input/output token counts (not dollar cost). If this pushes the agent over its remaining budget, the library automatically attempts priority-weighted reallocation to cover the shortfall from eligible donor agents before failing. The response reports whether reallocation was triggered and, if so, exactly which donor agents gave up how many tokens. Fails with a structured budget_exceeded error if no combination of donors can cover the shortfall - it never silently overspends. |
| get_remaining_budgetA | Return a single agent's current remaining token budget, along with its allocated total, consumed total, priority, and protected minimum reserve. Use this to check whether an agent is close to starved before deciding whether to request a reallocation. |
| request_reallocationA | The core allocation-decision tool. Given an agent that needs additional tokens right now, run the library's priority-weighted borrowing logic to pull spare budget from eligible donor agents - starting with the lowest-priority, most-idle ones - and apply it for real. A donor is only eligible if its priority is <= the needy agent's priority (budget never flows from a more important agent to a less important one) and it never gives up tokens below its own protected min_reserve. Returns a concrete plan: which agents gave up how many tokens, which agent received them, why each donor was eligible, and how much of the requested amount could not be covered (if any). This performs a real reallocation against the live ledger, not a dry-run simulation - call get_remaining_budget first if you only want to inspect state without moving tokens. |
| get_budget_snapshotA | Return the full current state of every registered agent - priority, allocated budget, consumed tokens, remaining budget, and min_reserve - as structured JSON. Use this for a system-wide view before deciding whether a reallocation is needed, or to let an orchestrator/human inspect overall budget health across all agents at once. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 5 tools
Each tool maps to a distinct action: registration, spend recording, single-agent read, system-wide read, and reallocation. Although record_spend can trigger reallocation as a side effect, the descriptions clearly separate that automatic behavior from the explicit request_reallocation decision tool.
All tool names follow a consistent snake_case verb_noun pattern: register_agent, record_spend, get_remaining_budget, get_budget_snapshot, request_reallocation. The verb and noun choices are predictable and match each tool's purpose.
Five tools is well-scoped for a narrow budget-management domain. Each tool earns its place, covering registration, spending, inspection, and reallocation without redundancy or bloat.
The core lifecycle is covered: register agents, record spend, inspect individual and global state, and manually reallocate budget. Minor gaps include no explicit unregister/agent removal or direct priority adjustment without re-registering/resetting, but these are workable limitations rather than blocking dead ends.