Skip to main content
Glama

Create a scoped API key (needs approval)

create_api_key

Mints a NEW least-privilege redu API key for a deployed app or automation to use (e.g. to add a backup feature). GUARDRAIL: the first call does NOT create anything. It returns a confirmation the user must approve, because a key is a long-lived credential that acts on the account and ANY usage of it is BILLED to the account owner. Show the user the name, the exact scopes, and the billing notice, get their explicit approval, then call again with confirm:true. This is required even in yolo/auto mode. The secret is returned ONCE.

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": {
      "name": "<name>",
      "scopes": "<scopes>"
    },
    "name": "create_api_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesA recognizable name for the key, e.g. 'supabase-backups'.
scopesYesLEAST-PRIVILEGE scopes the key may use, e.g. ['instance:read','backup:read','backup:create','backup:restore']. Grant only what the feature needs. Discover the catalog via GET /v1/capabilities (grammar '<resource>:<action>'). billing/subscription/payment/admin are human-only and cannot be granted.
confirmNoSet true ONLY after the user has explicitly approved (see the confirmation the first call returns). Leave unset to get the approval prompt first. Do NOT set it yourself.
expires_in_daysNoOptional: auto-expire the key after N days.

Output Schema

NameRequiredDescriptionDefault
keyNo
modeNo
nameNo
nextNo
errorNo
scopesNo
statusNo
detailsNo
messageNo
warningNo
recoveryNo
expires_atNo
validationNo
billing_noticeNo
account_noticesNo
needs_confirmationNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • addedOutput schema / properties / details
      Added value: +{}
    • addedOutput schema / properties / error / anyOf
      Added value: +[
      +  {
      +    "anyOf": [
      +      {
      +        "not": {}
      +      },
      +      {
      +        "type": "boolean"
      +      }
      +    ]
      +  },
      +  {
      +    "anyOf": [
      +      {
      +        "not": {}
      +      },
      +      {
      +        "type": "boolean"
      +      }
      +    ]
      +  }
      +]
    • removedOutput schema / properties / error / type
      Removed value: -"boolean"
    • addedOutput schema / properties / message
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / recovery
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / status
      Added value: +{}
    • addedOutput schema / properties / validation / anyOf
      Added value: +[
      +  {
      +    "anyOf": [
      +      {
      +        "not": {}
      +      },
      +      {}
      +    ]
      +  },
      +  {
      +    "anyOf": [
      +      {
      +        "not": {}
      +      },
      +      {}
      +    ]
      +  }
      +]
  2. Changed1 schema field changed
    • addedOutput schema / properties / account_notices
      Added value: +{
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "dismissible": {
      +        "type": "boolean"
      +      },
      +      "id": {
      +        "type": "string"
      +      },
      +      "message": {
      +        "type": "string"
      +      },
      +      "url": {
      +        "format": "uri",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "message",
      +      "url",
      +      "dismissible"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  3. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only say the tool is a non-idempotent, non-read-only, non-destructive open-world write. The description goes well past that: the first call mutates nothing, approval is mandatory, usage is billed to the account owner, and the secret is returned once and cannot be re-read. That is exactly the behavioral context an agent needs before invoking a credential-minting tool.

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?

Purpose is front-loaded, then the guardrail, then the secret-handling caveat — a sensible order with no filler sentences. The capitalized emphasis (NEW, GUARDRAIL, ONCE, BILLED) is effective but slightly heavy-handed, keeping it just below a 5.

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?

An output schema exists so return values need no explanation, and the one return fact that matters — the secret appears exactly once — is called out. Combined with the approval workflow and billing disclosure, nothing an agent needs to call this safely 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?

Schema coverage is 100%, so the baseline is 3, but the description adds meaning the schema does not: that the name and the exact scopes must be surfaced to the user for approval, and that scope usage carries billing consequences. It does not touch expires_in_days, which the schema already documents adequately.

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 ('Mints a NEW least-privilege redu API key') plus the intended consumer ('a deployed app or automation'), which separates it from list_api_keys/delete_api_key and from the create_* infrastructure siblings. The concrete example ('e.g. to add a backup feature') makes the intended use unmistakable.

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?

Explicitly describes the required two-phase invocation — first call returns an approval prompt, second call with confirm:true actually creates the key — and notes this holds 'even in yolo/auto mode'. It does not address when an agent should prefer a different key type such as create_run_key, so the alternative-selection guidance is incomplete rather than absent.

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