Skip to main content
Glama

translate_pin_data

Translate encrypted PIN blocks between ISO/AS2805 formats inside APC HSM for acquirer PIN routing, enforcing PCI PIN compliance while keeping the PIN clear text never exposed.

Instructions

Call this when implementing acquirer PIN routing, verifying a PIN translation flow, or checking whether a given format-to-format translation is legal under PCI PIN. This is the core HSM operation in every acquiring PIN path.

Translates a PIN block between encryption zones inside the APC HSM boundary — the PIN is never exposed in clear text. Compliance rules are enforced:

  • PAN must not change between incoming and outgoing formats (PCI PIN Req 3-3)

  • Only legal ISO 9564 format translations are permitted (Req 3-3)

  • Fixed TDES PIN keys are prohibited since 1 January 2023 (Req 2-2)

Preferred flow: AES DUKPT (Format 4) inbound → ZPK AES (Format 4 or 0) outbound

incoming_translation_attributes examples: ISO Format 4 (AES): {"IsoFormat4": {"PrimaryAccountNumber": "1712345678901234"}} ISO Format 0 (TDES): {"IsoFormat0": {"PrimaryAccountNumber": "1712345678901234"}} AS2805 Format 0: {"As2805Format0": {"PrimaryAccountNumber": "1712345678901234"}}

incoming_dukpt_attributes (when incoming key is a BDK): {"KeySerialNumber": "<10 or 12 byte KSN hex>"}

incoming_as2805_attributes (when incoming block uses AS2805 format): {"SessionKeyDerivationAttributes": {...}}

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

Args: incoming_key_identifier: ARN or alias of inbound PEK or BDK (or KEK for wrapped key) outgoing_key_identifier: ARN or alias of outbound PEK or BDK (or KEK for wrapped key) incoming_translation_attributes: PIN block format and PAN for inbound outgoing_translation_attributes: PIN block format and PAN for outbound encrypted_pin_block: Hex-encoded encrypted PIN block incoming_dukpt_attributes: Required when incoming key is a BDK (DUKPT) outgoing_dukpt_attributes: Required when outgoing key is a BDK (DUKPT) incoming_as2805_attributes: Required when incoming block uses AS2805 format incoming_wrapped_key: Optional TR-31 wrapped incoming PEK outgoing_wrapped_key: Optional TR-31 wrapped outgoing PEK

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
encrypted_pin_blockYes
incoming_wrapped_keyNo
outgoing_wrapped_keyNo
incoming_key_identifierYes
outgoing_key_identifierYes
incoming_dukpt_attributesNo
outgoing_dukpt_attributesNo
incoming_as2805_attributesNo
incoming_translation_attributesYes
outgoing_translation_attributesYes

Schema Changelog

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

  1. First observedv1.2.0

TDQS

A4.4/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 behavioral burden and meets it with meaningful details: the PIN is 'never exposed in clear text,' compliance rules are enumerated (PCI PIN Reqs 3-3 and 2-2), and the boundary condition 'inside the APC HSM boundary' is stated. It also discloses that fixed TDES PIN keys are prohibited since 2023, a time-sensitive constraint an agent must know. It stops short of describing output format, permissions, or error behavior, but the security and compliance context is strong.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but deliberately structured: usage trigger, operation summary, compliance rules, preferred flow, examples, then a compact Args list. It front-loads the most important decision cues. Some redundancy exists, such as 'core HSM operation' following the call-when clause, but overall it earns its length for a 10-parameter HSM tool.

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?

For a complex 10-parameter tool with no annotations and no output schema, the description covers selection, security, compliance, parameter conditions, and format examples, which is unusually complete. The main gap is that it never states what the tool returns, so an agent may be unsure about the response shape. Despite that, the operational details are sufficient for correct invocation in the described scenarios.

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 compensates thoroughly: every parameter appears in the Args list with meaning, and conditional parameters are explicitly marked, e.g., 'Required when incoming key is a BDK (DUKPT).' The JSON examples illustrate nested structures for translation attributes, DUKPT, AS2805, and wrapped-key paths. This adds substantial meaning far beyond the bare schema.

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 opens with explicit when-to-use triggers and then states the operation: 'Translates a PIN block between encryption zones inside the APC HSM boundary.' This clearly distinguishes from sibling PIN operations like generate_pin_data and verify_pin_data by focusing on translation between zones. The verb 'Translates' plus the encryption-zone scope is specific and unambiguous.

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?

It gives explicit triggers: 'implementing acquirer PIN routing, verifying a PIN translation flow, or checking whether a given format-to-format translation is legal under PCI PIN.' It also describes the 'Preferred flow,' which guides input/output format selection. However, it never names sibling alternatives or states when to use generate/verify instead, so it lacks explicit exclusions.

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