Skip to main content
Glama

create_scoped_key

Destructive

Create a key scoped to one agent for self-provisioning or rotating per-agent credentials. Store the plaintext key immediately; it is returned only once.

Instructions

Create an Agent key (chr_ak_*) that can only act on behalf of a single agent. Use this to self-provision or rotate per-agent credentials. The plaintext key is returned exactly once in the response — store it immediately, it cannot be retrieved later. Requires an Organization key.

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": {
      "agent_id": "<agent_id>"
    },
    "name": "create_scoped_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
labelNoHuman-readable label for the key
agent_idYesAgent ID this key is scoped to
expires_inNoWhen the key stops working, from now. Omit for a key that never expires. After it expires, requests fail with 401 key_expired.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.8.4
    • addedInput schema / properties / agent_id / allOf
      Added value: +[
      +  {
      +    "pattern": "^[A-Za-z0-9_-]*$",
      +    "type": "string"
      +  },
      +  {
      +    "pattern": "^agt_",
      +    "type": "string"
      +  }
      +]
    • addedInput schema / properties / agent_id / maxLength
      Added value: +128
    • addedInput schema / properties / agent_id / minLength
      Added value: +1
    • removedInput schema / properties / agent_id / pattern
      Removed value: -"^agt_"
  2. Changed1 schema field changedv1.6.2
    • addedInput schema / properties / expires_in
      Added value: +{
      +  "description": "When the key stops working, from now. Omit for a key that never expires. After it expires, requests fail with 401 key_expired.",
      +  "enum": [
      +    "30d",
      +    "60d",
      +    "90d",
      +    "180d",
      +    "365d"
      +  ],
      +  "type": "string"
      +}
  3. First observedv1.2.5

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and non-idempotent, and the description adds critical behavior beyond them: the plaintext key is returned exactly once and cannot be retrieved later, and an Organization key is required. These are the two facts an agent most needs to avoid losing a credential or failing auth.

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?

Four short sentences, front-loaded with purpose, then usage, then the one-time-return warning, then the auth prerequisite. No filler, and the most failure-prone fact (key shown once) is given its own sentence.

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?

With no output schema, the description correctly explains what comes back (the plaintext key, once) and the auth requirement for calling it. For a three-parameter creation tool, nothing an agent needs to invoke it safely is missing.

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 three parameters (agent_id, label, expires_in) are already documented, including the 401 key_expired behavior for expiry. The description reinforces the agent_id scoping concept but adds no syntax or constraint detail beyond the schema, which matches the baseline.

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 an Agent key') plus the key format (chr_ak_*) and the scope constraint ('only act on behalf of a single agent'). It doesn't explicitly contrast with siblings like revoke_scoped_key or list_scoped_keys, but the scoping and key-prefix details make the purpose 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?

'Use this to self-provision or rotate per-agent credentials' gives clear usage context, including the rotation case. It stops short of naming an alternative tool or stating when not to use it, so it sits just below the explicit when/when-not bar.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.