Skip to main content
Glama

unkey

Create an API key

unkey_create_key
Destructive

Issue a new API key under an API. The plaintext key is returned ONCE in the response and cannot be retrieved later unless recoverable is set. Unkey: POST /v2/keys.createKey.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metaNoArbitrary JSON metadata.
nameNoA human-readable label for the key.
apiIdYesThe API to issue the key under.
rolesNoRole names to attach.
prefixNoPrefix for the generated key, e.g. acme.
enabledNoCreate the key enabled. Defaults to true.
expiresNoExpiry as a Unix timestamp in milliseconds.
byteLengthNoEntropy in bytes. Defaults to 16.
externalIdNoThe identity (your user or org id) this key belongs to.
permissionsNoPermission names to attach.
recoverableNoStore the key encrypted so it can be shown again later. Defaults to false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Adds genuinely useful behavioral context beyond the sparse annotations: the plaintext key is returned ONCE and cannot be retrieved later unless recoverable is set. This signals an irreversible/one-shot property that an agent must handle carefully. It does not contradict the destructiveHint annotation.

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?

Two tightly written sentences with the critical one-shot key behavior front-loaded before the API endpoint notation. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter create tool with no output schema, the description covers the essential behavioral contract (one-time key return, recoverability) that the annotations and schema cannot. It leaves usage routing and permission requirements unstated, but the core information for correct invocation is present.

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%, so all 11 parameters (meta, prefix, expires, byteLength, roles, etc.) are already documented in the schema. The description only reinforces the recoverable flag and adds no syntax or format detail beyond it; baseline 3 applies.

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 ('Issue') and resource ('a new API key') with scope ('under an API'). An agent can distinguish this from sibling creators like unkey_create_api and unkey_create_identity without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains behavior but never says when to use this tool versus alternatives or prerequisites (e.g., needing an existing apiId, or choosing this over unkey_create_identity). Usage is only implied by the tool name and the word 'Issue'.

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.