Skip to main content
Glama

Update Api Key

update_api_key
Read-onlyIdempotent

Change an API key's active status, expiry, spend limit, reset interval, or IP allowlist. Only supplied fields update, so you can disable, re-enable, or restrict access without replacing the key.

Instructions

Change an API key: disable or re-enable it, or change its expiry, spend limit, reset window or IP allowlist. Only the given fields change. ADMIN keys can be changed only in the dashboard. Needs an ADMIN key. If key management is turned off on this server, nothing changes and the result gives the dashboard link instead.

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": {
      "key_id": "<key_id>"
    },
    "name": "update_api_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
activeNoFalse disables the key, True enables it again
key_idYesThe key's numeric id (see list_api_keys)
expires_atNoWhen the key stops working, YYYY-MM-DD. Optional
spend_limitNoSpend cap in USD for each reset window. Optional
ip_whitelistNoIP addresses or CIDR ranges allowed to use the key
reset_intervalNoHow often the spend counter resets. Optional

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.0

TDQS

A3.7/5.0
Behavior1/5

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

The description clearly describes a mutation (disabling a key, changing its spend limit and allowlist), while the annotations declare readOnlyHint=true and destructiveHint=false. That is a direct conflict over whether the tool writes state. The description otherwise carries excellent extra context — ADMIN key prerequisite, ADMIN-key dashboard-only restriction, and the no-op-with-dashboard-link outcome when key management is disabled — but the contradiction with the declared read-only hint is disqualifying.

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?

Four compact sentences, front-loaded with the action and affected fields, followed by the update semantics, the permission prerequisite, and the failure mode. No sentence is filler and the ordering prioritizes what an agent needs to decide whether to call the tool.

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 six-parameter mutation tool with an output schema, the description covers the permission prerequisite, partial-update behavior, an excluded key class, and the degraded-mode outcome for a disabled feature. Nothing an agent needs to call it correctly is missing; only the annotation mismatch undermines confidence.

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 description coverage is 100%, and each parameter already carries its own description (active as disable/enable, expires_at format, spend_limit USD per reset window, ip_whitelist, reset_interval enum). The description adds no syntax or format detail beyond that, so the baseline of 3 applies; its contribution is the partial-update framing rather than parameter meaning.

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 ("Change an API key") and immediately enumerates the mutable facets: disable/re-enable, expiry, spend limit, reset window, IP allowlist. This is enough for an agent to distinguish it from create_api_key, delete_api_key, get_api_key and list_api_keys without opening a schema.

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?

It gives clear context for use (changing specific key attributes, with "Only the given fields change" telling the agent it can do partial updates) plus an explicit exclusion: ADMIN keys cannot be changed here, only in the dashboard. What it lacks is any explicit routing to sibling tools such as delete_api_key when the intent is removal rather than modification.

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