Skip to main content
Glama
Metrx MCP Server

Metrx MCP Server

by metrxbots

Update Budget Mode

metrx_update_budget_mode
Idempotent

Change an existing budget's enforcement mode (alert_only, soft_block, hard_block) or pause and resume it. Requires an admin-scope API key; blocking modes apply only to gateway-routed LLM calls.

Instructions

Change the enforcement mode of an existing budget, pause it, or ask to resume it. Use "alert_only" for monitoring, "soft_block" for overridable limits, or "hard_block" to block. "soft_block" and "hard_block" act only on LLM calls routed through the Metrx gateway (proxy); calls reported by the SDK or OpenTelemetry are never blocked. They are unavailable while the gateway's Cloudflare settings for budget sync are unset: the server then refuses them with 409 ENFORCEMENT_UNAVAILABLE and only "alert_only" works. Needs an API key with the 'admin' scope (an org owner or admin mints one in Settings → Security → API Keys); any other key is refused with 403 — then make the change at https://app.metrxbot.com/settings/budgets. Do NOT use to create new budgets — use set_budget for that. Requires an API key with the 'admin' scope.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "budget_id": "<budget_id>"
    },
    "name": "metrx_update_budget_mode"
  }
}

Input Schema

NameRequiredDescriptionDefault
pausedNotrue pauses the budget; false resumes it (refused while a hard_block budget is still at its limit for the period — raise the limit first)
budget_idYesThe budget configuration ID to update
enforcement_modeNoNew enforcement mode. soft_block/hard_block: gateway traffic only; 409 ENFORCEMENT_UNAVAILABLE while gateway enforcement is not configured

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.5.0
    • changedInput schema / properties / enforcement_mode / description
      Previous value: -"New enforcement mode"New value: +"New enforcement mode. soft_block/hard_block: gateway traffic only; 409 ENFORCEMENT_UNAVAILABLE while gateway enforcement is not configured"
    • changedInput schema / properties / paused / description
      Previous value: -"Set to true to pause the budget, false to resume"New value: +"true pauses the budget; false resumes it (refused while a hard_block budget is still at its limit for the period — raise the limit first)"
  2. First observedv0.1.2

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare it is a non-read-only, idempotent, non-destructive mutation; the description adds far more — enforcement applies only to gateway-proxied LLM calls and never to SDK/OTel-reported traffic, unconfigured gateway sync yields 409 ENFORCEMENT_UNAVAILABLE, and non-admin keys yield 403 with a UI fallback. These are exactly the operational constraints an agent cannot infer from structured fields.

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

Conciseness4/5

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

Front-loaded with the action, then modes, then constraints, then the exclusion — a sensible ordering with no filler. The one clear waste is the trailing sentence repeating "Requires an API key with the 'admin' scope," which already appeared earlier in the description verbatim.

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 three-parameter mutation with no output schema, the description covers error codes, auth requirements, scope limitations, the creation alternative, and a manual fallback path. An agent has everything needed to call it and to interpret the two likely failure responses.

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

Parameters3/5

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

Schema coverage is 100% and the enum values, paused semantics, and the 409 behavior are already documented in the schema descriptions, so the description largely restates them. It adds the framing that soft/hard block act only on gateway traffic, but nothing about budget_id or the interaction between paused and enforcement_mode beyond what the schema says. Baseline 3 is appropriate when the schema does the heavy lifting.

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?

States a specific verb and resource ("Change the enforcement mode of an existing budget") plus the two secondary operations (pause/resume), and explicitly routes budget creation to set_budget. An agent can distinguish this from metrx_set_budget and metrx_get_budget_status without opening either schema.

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

Usage Guidelines5/5

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

Gives per-mode selection guidance ("alert_only" for monitoring, "soft_block" for overridable limits, "hard_block" to block), an explicit exclusion with the correct alternative ("Do NOT use to create new budgets — use set_budget"), and prerequisites that gate usage (admin scope, gateway Cloudflare settings).

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