Skip to main content
Glama

Decapsulate a shared secret

crypto_kem_decapsulate

Recover an ML-KEM shared secret from a key handle and hex ciphertext; returns an opaque symmetric key handle while secret key material stays server-side.

Instructions

Recover an ML-KEM shared secret with an ml-kem key handle (512, 768, 1024). Returns a symmetric-256 keyHandle for the shared secret. 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": {
      "keyHandle": "<keyHandle>",
      "ciphertext": "<ciphertext>"
    },
    "name": "crypto_kem_decapsulate"
  }
}

Input Schema

NameRequiredDescriptionDefault
levelNoML-KEM security level (512, 768, or 1024). Default is inferred from key or 768.
keyHandleYesHandle of the ml-kem key. Key handles look like 'kh_' followed by 32 hex characters.
ciphertextYesHex-encoded ML-KEM ciphertext (1536, 2176, or 3136 hex characters).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.41

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false, destructiveHint=false and openWorldHint=false, so the bar is lower. The description adds real context beyond them: key material never leaves the server and only an opaque keyHandle crosses the boundary, which tells the agent what to expect back and where the secret lives.

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?

Three short sentences, front-loaded with the action, then the return, then the security boundary. No filler and nothing out of order.

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?

No output schema exists, but the description compensates by naming the return value (a symmetric-256 keyHandle). For a three-parameter crypto primitive whose schema is fully documented, this is nearly complete; only the intended downstream consumer of the keyHandle is left implicit.

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 enum values, handle pattern and ciphertext length constraints all documented in the schema, so baseline 3 applies. The description only restates the level values and the keyHandle return type without adding format or validation detail.

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 ('Recover an ML-KEM shared secret') plus the parameter family (512/768/1024) and the return type. It implicitly separates itself from crypto_hybrid_kem_decapsulate by naming ML-KEM rather than hybrid, but never says so explicitly.

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 only implied: an agent can infer this is the plain ML-KEM counterpart to the hybrid decapsulate and that the returned keyHandle feeds a later decrypt, but no when-to-use, when-not, or explicit alternative is named.

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