Skip to main content
Glama

Set a model key's default gateway, community-supply switch or max price

update_key
Destructive

Set a model key's default gateway, community-supply switch or max price

Changes one of the account's own model keys: gateway sets or clears the gateway it runs through by default (a gateway's name from the list_gateways tool, or null for none; requests on the key then go through it, and a request naming another with the x-klinn-gateway header is refused with 403 gateway_locked), communitySupply sets whether community-supplied capacity may serve its requests (false keeps every request on our own routes), and maxPrice sets or clears its default limit order ({input, output, cache} USD per 1M tokens; prompt, completion and input_cache_read are accepted too: a request nothing in the market is within is refused with 422 no_offer_under_limit and billed nothing). minDiscount sets or clears its default minimum discount (0 to 100: its requests are served only at least that many percent under a model's list price; the same 422 when nothing in the market is). speed sets or clears its default speed ({sort, minThroughput, maxLatencySecs}: a request's own settings and its gateway's come first; see /docs/speed). Each field changes only when given; give at least one. New requests follow within about a minute. A name no gateway of yours has is 400 invalid_request; a revoked key, a customer's key or an unknown id is 404. Returns the key.

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": {
      "id": "<id>"
    },
    "name": "update_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesThe key id.
speedNoThe key's default speed ({sort, minThroughput, maxLatencySecs}); null clears it. A request's own settings and its gateway's come first. New requests follow within about a minute.
gatewayNoThe name of the gateway the key's requests run through by default (one of GET /gateways), or null for none.
ioRatioNoThe key's expected input:output ratio, as a number of input tokens per output token (15) or a string such as "15:1" or "1:4"; null clears it. A request's own x-klinn-io-ratio header and its gateway's io_ratio come first. New requests follow within about a minute.
maxPriceNoThe key's default limit order: the most its requests are billed per 1M tokens, per leg; null clears it. A request's own limit and its gateway's come first. New requests follow within about a minute.
minDiscountNoThe key's default minimum discount, 0 to 100: its requests are served only at least this many percent under a model's list price; null clears it. A request's own and its gateway's can only make it stricter. New requests follow within about a minute.
priceFalloverNoWhether the key's requests may go to a dearer source when none can serve them at the model's price: false keeps them at the model's price, true allows it, null returns to the default (on). The request's own allow_price_fallover setting, and any price limit, come first. New requests follow within about a minute.
communitySupplyNoWhether community-supplied capacity may serve the key's requests; false keeps every request on our own routes. New requests follow within about a minute.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations declare destructiveHint=true and idempotentHint=false, but add nothing about the actual side effects. The description carries that weight well: it discloses propagation lag ('New requests follow within about a minute'), the precedence ordering of request vs gateway settings, the null-clears behavior, and precise failure codes (403 gateway_locked, 400 invalid_request, 404 for revoked/customer keys, 422 no_offer_under_limit with no billing). It stops short of describing the returned key's shape, which is fine given no output schema.

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

Conciseness3/5

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

The first line restates the title verbatim, which is pure duplication, and the body is a single densely nested paragraph where clauses about precedence, error codes and propagation repeat almost verbatim for each field. The information is front-loaded and each sentence pays for itself, but the parenthetical stacking makes it harder to scan than it needs to be.

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 an 8-parameter mutator with no output schema, the description covers everything an agent needs: what each field does, that at least one must be given, how nulls clear values, precedence with request/gateway settings, propagation delay, and the full error surface including the end-state of a successful call ('Returns the key').

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 the baseline is 3, but the description adds operational meaning the per-parameter descriptions do not duplicate neatly: the gateway name must come from list_gateways and locking yields 403, an unsatisfiable limit order yields 422 and bills nothing, and each field is independently optional. It does omit ioRatio and priceFallover from the prose entirely despite both being parameters.

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 opens with a specific verb and resource ('Set a model key's default gateway, community-supply switch or max price') and then enumerates every mutable field (gateway, communitySupply, maxPrice, minDiscount, speed, ioRatio, priceFallover) with what each controls. It also scopes ownership ('Changes one of the account's own model keys'), which separates it from update_gateway or set_key_budget without needing to name them.

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

Usage Guidelines3/5

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

It gives a real usage rule — 'Each field changes only when given; give at least one' — which prevents a no-op call, and it explains null semantics for clearing. However, it never states when to reach for this tool instead of the sibling mutators (update_gateway, set_key_budget), so alternative selection is left implicit.

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.

Resources