Skip to main content
Glama

Stream encrypt data (post-quantum)

crypto_stream_encrypt
Read-onlyIdempotent

Encrypt plaintext with post-quantum hybrid X25519, ML-KEM-768 and XChaCha20-Poly1305 AEAD; returns base64 ciphertext with anti-truncation protection.

Instructions

Encrypt plaintext using post-quantum hybrid STREAM AEAD (X25519 + ML-KEM-768 + XChaCha20-Poly1305) with anti-truncation protection. Returns base64 ciphertext.

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": {
      "plaintext": "<plaintext>",
      "x25519PublicKey": "<x25519PublicKey>",
      "mlKemPublicKey": "<mlKemPublicKey>"
    },
    "name": "crypto_stream_encrypt"
  }
}

Input Schema

NameRequiredDescriptionDefault
chunkSizeNoChunk size in bytes (minimum 64, default 65536).
plaintextYesPlaintext string to encrypt.
mlKemPublicKeyYesHex-encoded ML-KEM-768 public key (2368 hex characters).
x25519PublicKeyYesHex-encoded X25519 public key (64 hex characters).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.41

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and the pure-computation nature of encryption is consistent with that profile. The description adds useful context the annotations cannot convey — the hybrid KEM/AEAD pipeline, anti-truncation protection, and base64 output encoding. It does not mention failure modes such as malformed key material or plaintext exceeding the 1 MiB cap, so it stops short of a 4.

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?

Two tightly written sentences: the algorithm and protection guarantee come first, the return format second. No filler, no repetition of the title, nothing that could be cut without losing meaning.

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 states the return value as base64 ciphertext, and the fully documented schema covers all four parameters. The remaining gap is operational: no mention of error behavior for invalid or mismatched public keys, which matters for a cryptographic primitive with strict 64/2368-hex-character key requirements.

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 each parameter documenting format, length, and defaults, so the schema carries the parameter burden. The description adds no parameter-level detail beyond naming the algorithms that consume the two keys; 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?

The description gives a specific verb ('Encrypt plaintext') plus the exact construction (X25519 + ML-KEM-768 + XChaCha20-Poly1305) and the output form (base64 ciphertext). The 'STREAM' qualifier implicitly separates it from the non-stream crypto_encrypt, but it never names a sibling or states the distinguishing condition explicitly.

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

Usage Guidelines2/5

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

There is no when-to-use guidance: nothing says to pick this over crypto_encrypt for small payloads or over crypto_stream_multi_encrypt for multiple recipients. The agent must infer the choice from the word 'STREAM' alone, and no prerequisites (e.g., both public keys must be supplied) are stated.

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