Skip to main content
Glama

create_key

Mint a new named API key; the plaintext is returned ONCE. Requires admin scope.

    Delegate safely (WP-SCOPE): optional scopes (subset of read|spend|admin; omit for
    full power) + daily_credit_cap (credits/day; omit for uncapped) hand a sub-agent a
    key that can only do what you allow. Args: name (1-100), api_key (an admin-scoped
    key). Returns {api_key (store it), prefix, name, scopes, daily_credit_cap,
    created_at}. Errors: unauthorized, forbidden, invalid_request, rate_limited.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoLabel for the new key, 1-100 chars, shown by list_keys so you can tell delegated keys apart. Defaults to 'key'.key
scopesNoPowers the new key gets: read (free reads), spend (charged generate/score/remix), admin (key + account + webhook management). OMIT for a full-power key; pass a subset to hand a sub-agent strictly less power than you hold.
api_keyNoAPI key for this call. Omit to fall back to the Authorization: Bearer / X-API-Key request header (streamable-HTTP only), then the VHGENGINE_API_KEY env var (the stdio default). No key resolvable -> unauthorized.
daily_credit_capNoCredits this key may spend per UTC day, 1-100000; further charges on it are refused once reached (other keys are unaffected). Omit for uncapped. list_keys reports spent_today against this.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoThe label you gave it.
prefixNoFirst 12 chars, used by list_keys / revoke_key / get_usage(key_prefix=...).
scopesNoPowers granted, a subset of read/spend/admin (all three = full power).
api_keyNoThe plaintext key. Store it now; it is never readable again.
created_atNoCreation time, ISO-8601 UTC.
daily_credit_capNoPer-UTC-day spend ceiling, or null for uncapped.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed13 schema fields changed
    • addedInput schema / properties / api_key / description
      Added value: +"API key for this call. Omit to fall back to the Authorization: Bearer / X-API-Key request header (streamable-HTTP only), then the VHGENGINE_API_KEY env var (the stdio default). No key resolvable -> unauthorized."
    • changedInput schema / properties / daily_credit_cap / anyOf
      Previous value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "maximum": 100000,
      +    "minimum": 1,
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / daily_credit_cap / description
      Added value: +"Credits this key may spend per UTC day, 1-100000; further charges on it are refused once reached (other keys are unaffected). Omit for uncapped. list_keys reports spent_today against this."
    • addedInput schema / properties / daily_credit_cap / maximum
      Added value: +100000
    • addedInput schema / properties / daily_credit_cap / minimum
      Added value: +1
    • addedInput schema / properties / name / description
      Added value: +"Label for the new key, 1-100 chars, shown by list_keys so you can tell delegated keys apart. Defaults to 'key'."
    • addedInput schema / properties / name / maxLength
      Added value: +100
    • addedInput schema / properties / name / minLength
      Added value: +1
    • addedInput schema / properties / scopes / description
      Added value: +"Powers the new key gets: read (free reads), spend (charged generate/score/remix), admin (key + account + webhook management). OMIT for a full-power key; pass a subset to hand a sub-agent strictly less power than you hold."
    • addedInput schema / properties / scopes / items
      Added value: +{
      +  "enum": [
      +    "read",
      +    "spend",
      +    "admin"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / description
      Added value: +"A newly minted API key. The plaintext is returned ONCE."
    • addedOutput schema / properties
      Added value: +{
      +  "api_key": {
      +    "description": "The plaintext key. Store it now; it is never readable again.",
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "created_at": {
      +    "description": "Creation time, ISO-8601 UTC.",
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "daily_credit_cap": {
      +    "description": "Per-UTC-day spend ceiling, or null for uncapped.",
      +    "type": [
      +      "number",
      +      "null"
      +    ]
      +  },
      +  "name": {
      +    "description": "The label you gave it.",
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "prefix": {
      +    "description": "First 12 chars, used by list_keys / revoke_key / get_usage(key_prefix=...).",
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "scopes": {
      +    "description": "Powers granted, a subset of read/spend/admin (all three = full power).",
      +    "type": [
      +      "array",
      +      "null"
      +    ]
      +  }
      +}
    • removedOutput schema / title
      Removed value: -"create_keyDictOutput"
  2. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  3. First observed

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries full burden. It discloses the one-time plaintext return, admin scope requirement, full-power vs scoped behavior, daily cap semantics, auth parameter, return fields, and error types. This is rich, honest behavioral disclosure.

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?

The description is structured into a quick-essential first line, a delegation rationale paragraph, then compact Args/Returns/Errors lines. Every sentence adds value—no fluff or repetition—and it stays focused despite covering critical security details.

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?

The tool has 4 params, an output schema, and genuine complexity (auth scopes, caps, one-time secret). The description covers purpose, usage, return shape, auth requirements, and error cases. It is complete enough to invoke correctly without external documentation.

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% and the schema descriptions are already strong, but the description adds clarifying meaning: 'omit for full power,' 'store it' for the returned api_key, and 'admin-scoped key' for the api_key parameter. This goes beyond the schema baseline.

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 opens with 'Mint a new named API key; the plaintext is returned ONCE. Requires admin scope,' which uses a specific verb ('mint'), resource ('API key'), and key trait (one-time plaintext). This clearly distinguishes it from siblings like list_keys, revoke_key, and add_credits.

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?

It explicitly states the admin-scope requirement and positions delegation use cases: 'Delegate safely... hand a sub-agent a key that can only do what you allow.' It does not name alternative tools, but the purpose is clearly distinct from revoke_key or list_keys, and the context is sufficient.

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