Skip to main content
Glama

Generate a key

crypto_generate_key

Generates RSA, ECC, Ed25519, post-quantum, symmetric, or HMAC keys; secret material stays on the server and an opaque keyHandle (plus public key for keypairs) is returned.

Instructions

Generate a key inside the server: a classical (RSA, ECC, Ed25519) or post-quantum (ML-KEM 512/768/1024 FIPS 203, ML-DSA 44/65/87 FIPS 204) keypair, a 256-bit symmetric key, or an HMAC-SHA256 key. Returns a keyHandle and, for keypairs, the public key. Secret key material stays inside the server; only an opaque keyHandle is returned.

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": {
      "type": "<type>"
    },
    "name": "crypto_generate_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeYesKey type: 'rsa', 'ecc', 'ed25519', 'x25519', 'ml-kem-512', 'ml-kem-768', 'ml-kem-1024', 'ml-dsa-44', 'ml-dsa-65', 'ml-dsa-87', 'symmetric-256', or 'hmac-sha256'.
curveNoElliptic curve for 'ecc': 'prime256v1' (P-256), 'secp384r1' (P-384), or 'secp256k1'. Default is 'prime256v1'.
modulusLengthNoModulus length for RSA (2048, 3072, 4096). Default is 2048.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.41

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false and destructiveHint=false, so the description's job is to add what those don't cover. It does: secret key material never leaves the server, only an opaque keyHandle is returned, and keypairs additionally yield a public key. It does not say how long the generated key persists or whether re-invoking with identical arguments yields a distinct key (implied by idempotentHint=false).

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?

Two sentences, front-loaded with the action, then the return contract. The long parenthetical enumeration with FIPS numbers is dense but each item carries real selection information; no sentence is filler.

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?

No output schema exists, so the description must explain returns — and it does, naming keyHandle and the public key and clarifying that secrets stay server-side. For a three-parameter, fully-enumerated generation tool, an agent has everything needed to call it correctly and interpret the result.

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% with enums on all three parameters, so the schema carries the parameter documentation burden and the baseline is 3. The description's type list omits x25519 and never mentions the 'curve' or 'modulusLength' parameters or their defaults, so it adds essentially nothing beyond the schema.

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 ('Generate a key inside the server') and enumerates the exact families produced: RSA/ECC/Ed25519, ML-KEM 512/768/1024, ML-DSA 44/65/87, symmetric-256, HMAC-SHA256. The phrase 'inside the server' plus the keyHandle-only return distinguishes it cleanly from siblings such as crypto_key_import.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: the server-side generation model suggests this is the tool to reach for when you need fresh key material rather than importing existing material, but no sibling (e.g. crypto_key_import) is named and no when-not condition is given. An agent must infer the routing decision from the wording.

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