Skip to main content
Glama

encrypt_data

Encrypt sensitive payment data, PIN blocks, and cardholder fields for secure storage or transmission using DUKPT, EMV session keys, or symmetric/asymmetric keys.

Instructions

Call this when encrypting cardholder data, PIN blocks, or sensitive payment fields for storage or transmission. Also use when implementing DUKPT session encryption or EMV session-key-based data confidentiality.

Supported key types: D0 (symmetric), D1 (asymmetric RSA), B0 (DUKPT), E1/E6 (EMV). All inputs and outputs are hexBinary encoded.

encryption_attributes examples: Symmetric AES-CBC: {"Symmetric": {"Mode": "CBC", "InitializationVector": "<16-byte hex>"}} DUKPT AES: {"Dukpt": {"KeySerialNumber": "", "Mode": "CBC", "DukptKeyDerivationType": "AES_128"}} EMV: {"Emv": {"MajorKeyDerivationMode": "EMV_OPTION_A", "PrimaryAccountNumber": "...", "PanSequenceNumber": "01", "SessionDerivationData": "...", "Mode": "CBC"}}

wrapped_key (dynamic key — TR-31 key block passed directly): {"WrappedKeyMaterial": {"Tr31KeyBlock": ""}, "KeyCheckValueAlgorithm": "CMAC"}

Args: key_identifier: Key ARN or alias of the KEK (when using wrapped_key) or the working key plain_text: Hex-encoded plaintext to encrypt encryption_attributes: Algorithm-specific parameters dict wrapped_key: Optional TR-31 wrapped working key (key_identifier becomes the KEK)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
plain_textYes
wrapped_keyNo
key_identifierYes
encryption_attributesYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.2.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses hexBinary encoding for all inputs/outputs, supports key type families, and explains that wrapped_key changes key_identifier to act as the KEK. It does not cover permissions or failure behavior, but the core behavioral traits are clearly disclosed.

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?

The description is front-loaded with when-to-use guidance and then provides dense, valuable detail: key types, encoding, parameter semantics, and illustrative examples. Despite its length, every section earns its place for a complex nested-object API.

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?

Given no output schema and four parameters including complex nested objects, the description supplies strong coverage: use cases, supported algorithms, wire encoding, and parameter examples. It does not explicitly describe the response shape or error cases, but the hexBinary output note and detailed examples make the tool adequately invocable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must fully document parameters. It does this thoroughly with an Args section and concrete JSON examples for encryption_attributes and wrapped_key, clarifying key_identifier's dual role as working key or KEK and marking wrapped_key as optional.

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?

The description clearly states the tool's purpose with specific verbs and resources: encrypting cardholder data, PIN blocks, or sensitive payment fields, plus DUKPT and EMV session encryption. It distinguishes itself from sibling tools by naming supported key types and algorithm families, leaving no ambiguity about what it does.

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

Usage Guidelines4/5

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

The opening 'Call this when...' gives explicit use-case context, including DUKPT session encryption and EMV key-based confidentiality. It does not explicitly contrast with alternatives like decrypt_data or re_encrypt_data, so it stops short of full exclusionary guidance.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/J8k3/aws-payment-cryptography-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server