Skip to main content
Glama

Encrypt data

crypto_encrypt

Encrypt plaintext with authenticated AES-256-GCM or ChaCha20-Poly1305 encryption using a symmetric-256 key handle; omit the handle to generate a new key and receive its handle.

Instructions

Encrypt plaintext with authenticated encryption (AES-256-GCM or ChaCha20-Poly1305) under a symmetric-256 key handle. Without keyHandle, a new key is generated and its handle returned. 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": {
      "plaintext": "<plaintext>"
    },
    "name": "crypto_encrypt"
  }
}

Input Schema

NameRequiredDescriptionDefault
algorithmNoEncryption algorithm ('aes-256-gcm' or 'chacha20-poly1305'). Default is 'aes-256-gcm'.
keyHandleNoHandle of a symmetric-256 key. If omitted, a new key is generated. Key handles look like 'kh_' followed by 32 hex characters.
plaintextYesPlaintext string to encrypt.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.41

TDQS

A3.7/5.0
Behavior4/5

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

Beyond the annotations, the description discloses the security-relevant behavior: authenticated encryption, server-side key custody, and that only an opaque handle ever leaves the server. This meaningfully supplements the non-readOnly, non-idempotent hints. It does not state the side effect that an omitted keyHandle creates persistent key state, nor any ciphertext output characteristics.

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, front-loaded with what the tool does and followed by the key-handling behavior. No filler and nothing that duplicates the title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/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 carries the burden of explaining return values, and it only covers the generated-key case ('its handle returned'); what the normal success response contains (ciphertext, nonce/tag, algorithm used) is left unstated. For a 3-parameter encryption tool that is an adequate but incomplete definition.

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 algorithm options, the keyHandle pattern, and the plaintext size limit all documented in the schema itself. The description restates the algorithm family and the key-generation-on-omission behavior rather than adding new meaning beyond it, so the 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 names a specific verb and resource ('Encrypt plaintext') and pins down the exact primitive ('authenticated encryption (AES-256-GCM or ChaCha20-Poly1305)') plus the key type ('symmetric-256 key handle'). It does not, however, distinguish itself from the sibling crypto_stream_encrypt, so an agent must infer the boundary between one-shot and streaming encryption.

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?

Useful conditional guidance is given for the keyHandle-absent path (a new key is generated and returned), which tells the agent this call can be self-contained. There is still no explicit when-to-use-this-vs-alternatives guidance — nothing says to prefer crypto_stream_encrypt for large or streamed payloads or crypto_generate_key when a key is wanted without encrypting.

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