Skip to main content
Glama

Set an API key's allowed IPs

update_api_key
DestructiveIdempotent

Sets or clears the IP allowlist of a runtime API key: allowed_ips replaces the list, and null or [] clears it. Each entry is an IP address or CIDR range (for example 203.0.113.7 or 198.51.100.0/24). Public addresses only, up to 100 entries, ranges no wider than /8 (IPv4) or /16 (IPv6). An empty list accepts calls from any IP. Calls from any other address get 403 with code ip_not_allowed. A change takes up to a minute to apply. A key held by an agent login cannot have a list. Requires the apikeys:write scope. Only API keys owned by the signed-in user can be changed. call_model with a restricted key is refused unless its list includes the address the MCP client connects from.

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": {
      "allowed_ips": "<allowed_ips>",
      "id": "<id>",
      "uuid": "<uuid>"
    },
    "name": "update_api_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesRuntime API key id
uuidYesProject UUID
allowed_ipsYesReplaces the key's allowlist; null or [] clears it so the key accepts any IP. IP addresses or CIDR ranges the key accepts calls from (for example 203.0.113.7 or 198.51.100.0/24). Public addresses only; up to 100 entries; ranges no wider than /8 for IPv4 or /16 for IPv6. Empty accepts any IP. Calls from any other address get 403 ip_not_allowed. A change takes up to a minute to apply.

Output Schema

NameRequiredDescriptionDefault
dataNo
metaNoEmpty for a single resource. Endpoint-specific context appears here rather than as a sibling of `data`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Goes well past the annotations (which only flag destructive=true and idempotent=true) by explaining replacement vs. clearing semantics, the 403 `ip_not_allowed` consequence for other addresses, an up-to-a-minute propagation delay, and the interaction with call_model. This is exactly the operational context an agent needs before locking down a key.

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 core replace/clear semantics, then constraints, then consequences. It is dense with useful facts, though a few clauses duplicate the schema verbatim and the sentence chain is long.

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?

Given a mutation tool with an output schema and full annotation coverage, the description supplies everything else an agent would need: scope requirement, ownership boundary, agent-login restriction, failure code, and propagation timing. Nothing material is left unstated.

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 description largely restates the `allowed_ips` schema text (CIDR examples, 100-entry cap, /8 and /16 limits, null/[] clearing) rather than adding new parameter meaning. The only genuinely extra semantics are the ownership and agent-login restrictions, which are framed as behavioral constraints rather than parameter guidance.

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: "Sets or clears the IP allowlist of a runtime API key." It distinguishes itself from create_api_key/delete_api_key by focusing on one field of an existing key, and names the field (`allowed_ips`) that it mutates.

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?

Gives clear preconditions and context: requires `apikeys:write`, only keys owned by the signed-in user, and keys held by agent logins cannot have a list. It does not name an alternative tool, but no sibling appears to offer this operation, so there is little routing ambiguity.

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