Skip to main content
Glama

Attach the Budget-Enforcing Proxy

ledger_proxy_attach
Read-onlyIdempotent

Point your provider traffic at the proxy so budget caps are enforced BEFORE the provider is contacted, instead of being reported afterwards.

This closes the gap where the brake was unreachable from MCP: an agent connected over MCP could record spend (ledger_track) but nothing could refuse a call. With this, the cap is enforced on every LLM call.

Returns the base_url to use, the two headers to send, and the exact change for the OpenAI and Anthropic SDKs. Your provider credential is NOT part of this: it stays in Authorization / x-api-key and is only forwarded, never stored.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYesthe agent whose budget the proxied calls are billed to
providerNowhich upstream to proxy: openai or anthropicopenai
agent_secretNothe agent's own secret (either this or workspace_key)
workspace_keyNothe owning workspace's key (either this or agent_secret)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, and the description adds meaningful behavioral context: enforcement happens BEFORE provider contact, provider credentials are forwarded but never stored, and the output contains base_url, headers, and SDK changes. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core action and consequence, then provides rationale, return contents, and credential safety. Every sentence earns its place and there is no filler or repetition of schema details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with only 4 parameters, 100% schema coverage, full annotations, and an output schema, this description is complete. It tells the agent what the tool does, why it matters, what it returns, and the key security behavior, without needing to reproduce structured schema details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds extra value by clarifying that the provider credential is not part of the tool's operation and stays in Authorization / x-api-key, which helps interpret agent_secret and workspace_key semantics beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource: 'Point your provider traffic at the proxy so budget caps are enforced', and specifies exactly what the tool returns. It clearly distinguishes this from ledger_track, which only records spend after the fact.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains the gap this tool fills versus ledger_track: MCP-connected agents could record spend but could not refuse calls, and this tool enforces caps on every LLM call. It does not explicitly state prerequisites or when-not-to-use cases, so it falls just short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.