Skip to main content
Glama

create_api_key

Create an API key with a role, prefix, expiry, and rate limit for integrations such as webhooks or n8n. Role-based access prevents permission escalation.

Instructions

Create API Key with role (anti-escalation enforced)

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

Input Schema

NameRequiredDescriptionDefault
nameYesAPI key name, for example ERP Webhook or Production n8n
roleNoRBAC role: admin has full access; editor has consumer and builder-read access; member has consumer access. Cannot exceed the caller's role.admin
prefixNoKey prefix: zhn_live_ for production, zhn_test_ for testing, zhn_dev_ for developmentzhn_live_
descriptionNoDescription of the key purpose
expires_in_daysNoDays until expiry; omit for no expiry
rate_limit_per_minuteNoRequests per minute, an integer of at least 1, validated against the tenant plan

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv2.2.4
    • changedInput schema / properties / description / description
      Previous value: -"Descrição do uso da chave"New value: +"Description of the key purpose"
    • changedInput schema / properties / expires_in_days / description
      Previous value: -"Dias até expiração (omitir para sem expiração)"New value: +"Days until expiry; omit for no expiry"
    • addedInput schema / properties / expires_in_days / minimum
      Added value: +1
    • changedInput schema / properties / expires_in_days / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / name / description
      Previous value: -"Nome da API Key (ex: \"Webhook eBarn\", \"n8n Produção\")"New value: +"API key name, for example ERP Webhook or Production n8n"
    • changedInput schema / properties / prefix / description
      Previous value: -"Prefixo da chave: zhn_live_ (produção), zhn_test_ (teste), zhn_dev_ (dev)"New value: +"Key prefix: zhn_live_ for production, zhn_test_ for testing, zhn_dev_ for development"
    • changedInput schema / properties / rate_limit_per_minute / description
      Previous value: -"Limite de requisições por minuto (validado contra plano do tenant)"New value: +"Requests per minute, an integer of at least 1, validated against the tenant plan"
    • addedInput schema / properties / rate_limit_per_minute / minimum
      Added value: +1
    • changedInput schema / properties / rate_limit_per_minute / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / role / description
      Previous value: -"Role RBAC: admin (todas as tools + REST), editor (consumer + builder-read), member (consumer only). Anti-escalação: não pode ser superior ao seu role"New value: +"RBAC role: admin has full access; editor has consumer and builder-read access; member has consumer access. Cannot exceed the caller's role."
  2. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare it is a non-idempotent write that is not destructive, so safety is covered. The description adds genuinely useful context beyond that: role assignment is subject to an anti-escalation check. It omits other behavior an agent would care about, such as whether the secret value is returned only once or whether creation requires elevated permissions.

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?

A single short sentence that is front-loaded with the action and has no wasted wording. Its brevity is close to under-specification rather than padding, so it does not hurt readability.

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

Completeness3/5

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

The rich six-parameter schema carries most of the load, and no output schema exists to explain. However, for a credential-minting tool with no output schema, the description does not say what is returned (e.g., the secret) or any rate/limit caveats, leaving a meaningful gap.

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%, so every parameter (including role enums and the escalation rule) is already documented in the schema. The description's mention of 'role' only echoes the schema and adds no syntax or format detail beyond it, making baseline 3 appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Create API Key') and mentions role scoping, so the action is unambiguous and distinguishable from list/get/update/delete siblings. It stops short of differentiating itself explicitly from any sibling, but the verb+resource pairing is clear.

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?

There is no guidance on when to use this versus update_api_key or how it relates to the other create_* tools. The only contextual hint, 'anti-escalation enforced', is a constraint rather than a when-to-use rule, and no prerequisites or exclusions are stated.

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