Skip to main content
Glama

Hybrid post-quantum KEM encapsulate

crypto_hybrid_kem_encapsulate

Encapsulate a shared secret with a hybrid X25519 + ML-KEM KEM and return the ephemeral public key, ML-KEM ciphertext, and opaque symmetric key handle while private key material stays server-side.

Instructions

Encapsulate a shared secret using Post-Quantum Hybrid KEM (X25519 + ML-KEM, RFC 9180/10024). Returns the classical ephemeral public key, ML-KEM ciphertext, and a symmetric-256 keyHandle for the combined 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": {
      "x25519PublicKey": "<x25519PublicKey>",
      "mlKemPublicKey": "<mlKemPublicKey>"
    },
    "name": "crypto_hybrid_kem_encapsulate"
  }
}

Input Schema

NameRequiredDescriptionDefault
levelNoML-KEM security level (512, 768, or 1024). Default is 768.
mlKemPublicKeyYesHex-encoded recipient ML-KEM public key (1600, 2368, or 3136 hex characters).
x25519PublicKeyYesHex-encoded recipient X25519 public key (64 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?

Beyond the annotations, it discloses the concrete return payload (ephemeral public key, ML-KEM ciphertext, 256-bit keyHandle) and the important security behavior that private material never leaves the server and only an opaque handle comes back. This meaningfully complements readOnlyHint=false/idempotentHint=false by explaining that each call mints fresh ephemeral material, though it never says so explicitly or warns that the keyHandle must be retained for later decapsulation.

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 tight sentences: purpose and standards first, then return values, then the key-handling guarantee. No filler, no repetition of the title, and the most decision-relevant facts are front-loaded.

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?

With no output schema, the description correctly spends its words on return values and the keyHandle security model, which is what an agent most needs. It is slightly incomplete for a non-idempotent crypto operation: it does not state that the handle must be preserved for decapsulation or how key-length/level mismatches are reported.

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%, with per-field descriptions covering hex encoding, key lengths, and the level enum default, so the schema already carries parameter meaning. The description adds no parameter-level guidance of its own (e.g. how level must match the recipient's ML-KEM key size), so baseline 3 applies.

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 ("Encapsulate") and resource ("shared secret using Post-Quantum Hybrid KEM") and pins the construction to X25519 + ML-KEM with RFC references, which an agent can distinguish from a plain classical KEM. It never names the sibling it differs from (crypto_kem_encapsulate for classical-only, crypto_hybrid_kem_multi_encapsulate for batches), so differentiation is left to inference.

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: the algorithm names tell an informed agent this is the PQ-hybrid option, but there is no explicit "use this instead of X when Y" and no stated prerequisites (e.g. recipient must hold the matching decapsulation key). No exclusions or failure conditions are given.

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