Skip to main content
Glama

create_api_key

Create a new API key. The secret key value is returned ONLY in this response — store it securely. Note: the secret will be visible in the AI conversation context. Optionally bind the key to a sub-account via profile_id — outbound messages sent with the key are then branded as that sub-account.

Agent usage: This operation requires 2FA. Before calling, complete the 2FA flow: (1) call start_2fa with action_type "api_key_create" and the user's preferred channel, (2) tell the user a code was sent and wait for them to verify, (3) poll get_2fa_status until status is "verified", (4) then call create_api_key — the backend session will be elevated. If you get a 403, the 2FA session has expired — restart the flow.

ACCESS: needs a Proof account. Authenticate this client (Claude Code: /mcp → Authenticate), or sign in with start_login — a session opens this tool — then call this tool again.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "create_api_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoHuman-readable key name
scopesNoPermission scopes for the key
profile_idNoBind the new key to a sub-account you own (24-hex id). Immutable after creation; omit for an unbound account-wide key.
environmentNoKey environment (default: production)

Output Schema

NameRequiredDescriptionDefault
idYesMongoDB ObjectId
keyYesThe full API key. Returned only in this response; it cannot be read again.
nameYes
prefixYes
scopesYes
warningYes
created_atYes
profile_idYesSub-account (PublicProfile) the key is bound to; null for unbound keys.
environmentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / profile_id / description
      Previous value: -"Bind the new key to a sub-account (PublicProfile) project you own (24-hex id). Immutable after creation; omit for an unbound account-wide key."New value: +"Bind the new key to a sub-account you own (24-hex id). Immutable after creation; omit for an unbound account-wide key."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "description": "A newly created or regenerated API key, with its full value — the one response that carries it.",
      +  "properties": {
      +    "created_at": {
      +      "type": "string"
      +    },
      +    "environment": {
      +      "type": "string"
      +    },
      +    "id": {
      +      "description": "MongoDB ObjectId",
      +      "type": "string"
      +    },
      +    "key": {
      +      "description": "The full API key. Returned only in this response; it cannot be read again.",
      +      "type": "string"
      +    },
      +    "name": {
      +      "type": "string"
      +    },
      +    "prefix": {
      +      "type": "string"
      +    },
      +    "profile_id": {
      +      "description": "Sub-account (PublicProfile) the key is bound to; null for unbound keys.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "scopes": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "warning": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "id",
      +    "key",
      +    "name",
      +    "prefix",
      +    "environment",
      +    "scopes",
      +    "profile_id",
      +    "created_at",
      +    "warning"
      +  ],
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • removedInput schema / additionalProperties
      Removed value: -false
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false, so the description carries real weight: it discloses the one-time secret exposure, warns the secret appears in AI conversation context, requires 2FA elevation, and explains 403 expiry behavior. It stops short of describing rate limits or what the response body contains, but the output schema covers returns.

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-loads the core action and the critical secret-handling warning, then the 2FA flow. The numbered steps are long but each is load-bearing; the access/authentication paragraph is somewhat redundant with the 2FA section.

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 mutation tool with an output schema and full parameter coverage, the description supplies everything an agent needs: prerequisites, ordering, failure recovery, and the security caveat about the returned secret.

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 baseline is 3, but the description adds meaning beyond the schema: it explains that profile_id causes outbound messages to be branded as that sub-account and that binding is immutable, which the schema only hints at.

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 ("Create a new API key") and immediately distinguishes it from siblings by noting the secret is returned only in this response, which separates it from regenerate_api_key and list_api_keys.

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 an explicit, ordered 2FA prerequisite flow (start_2fa → user verify → poll get_2fa_status → call), names the exact action_type, and explains the 403 recovery path. It also states the alternative of omitting profile_id for an account-wide key.

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.