Skip to main content
Glama

create_api_key

Create a new API key for your organization and retrieve the raw_key value, shown only once. Set an optional expiry and device limit to control access.

Instructions

Create a new API key for the current organization and return its raw_key value exactly once — it is never shown again, so store it immediately. expires_at optionally sets an ISO-8601 expiry and device_limit caps how many devices the key may register (validated against the plan ceiling, invalid_device_limit on excess). Key creation is rate-limited per organization (api_key_create_rate_limited). Use list_api_keys to see existing keys and revoke_api_key to retire one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelYesHuman-readable label identifying the key's purpose.
expires_atNoOptional ISO-8601 expiry timestamp for the key.
device_limitNoOptional per-key device cap; must not exceed the plan ceiling.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.1.3
    • addedInput schema / properties / device_limit / description
      Added value: +"Optional per-key device cap; must not exceed the plan ceiling."
    • addedInput schema / properties / expires_at / description
      Added value: +"Optional ISO-8601 expiry timestamp for the key."
    • addedInput schema / properties / label / description
      Added value: +"Human-readable label identifying the key's purpose."
  2. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only indicate readOnlyHint=false, but the description discloses critical behavioral traits: raw_key is returned exactly once and never shown again, creation is rate-limited per organization with the api_key_create_rate_limited error, and device_limit is validated against the plan ceiling. This goes well beyond the 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?

Three tight sentences with no filler. The most important warning (store raw_key immediately) is front-loaded, followed by parameter behavior, failure mode, and sibling routing.

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 creation tool with no output schema, the description sufficiently covers the return value (raw_key, one-time), error conditions, rate limiting, parameter validation, and related lifecycle tools. Nothing essential is missing.

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?

The schema already covers all three parameters, so the baseline is 3, but the description adds meaningful semantics: expires_at is ISO-8601, device_limit caps registered devices, and excess triggers invalid_device_limit. This clarifies behavior beyond the raw schema property descriptions.

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 ('Create a new API key for the current organization') and clarifies the tool is distinct from list_api_keys and revoke_api_key. It leaves no ambiguity about what action is performed.

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?

It explicitly routes the agent to list_api_keys for viewing existing keys and revoke_api_key for retiring one, giving clear when-to-use guidance versus alternatives. It also flags rate limiting and a specific error code, helping the agent decide when this call is appropriate.

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

Deploy Server

Other Tools