Skip to main content
Glama

generate_mac_emv_pin_change

Generate an EMV PIN change MAC using P0, E2, and E1 keys for issuer scripts, CHANGE REFERENCE DATA, or offline PIN change.

Instructions

Call this before implementing any EMV PIN change flow — issuer script, CHANGE REFERENCE DATA (INS=24), or offline PIN change MAC assembly.

IMPORTANT: This operation requires THREE separate keys, not one: P0 — PIN Encryption Key: encrypts the new PIN block E2 — EMV Integrity Key: generates the script MAC E1 — EMV Confidentiality Key: encrypts the script data

Single-key EMV MAC helpers (E2 only) cannot replicate this. A full EMV PIN change requires all three key types to be provisioned in APC separately.

Required key types: new_pin_pek_identifier: P0 (PIN Encryption Key for new PIN) secure_messaging_integrity_key_identifier: E2 (EMV integrity) secure_messaging_confidentiality_key_identifier: E1 (EMV confidentiality)

Args: new_pin_pek_identifier: ARN or alias of P0 key for new PIN secure_messaging_integrity_key_identifier: ARN or alias of E2 key secure_messaging_confidentiality_key_identifier: ARN or alias of E1 key message_data: Hex-encoded script command data new_encrypted_pin_block: Hex-encoded new PIN block encrypted under PEK pin_block_format: ISO_FORMAT_0, ISO_FORMAT_1, or ISO_FORMAT_3 (ISO_FORMAT_4 is not supported by this operation) derivation_method_attributes: EMV derivation method (Visa, Mastercard, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
message_dataYes
pin_block_formatYes
new_pin_pek_identifierYes
new_encrypted_pin_blockYes
derivation_method_attributesYes
secure_messaging_integrity_key_identifierYes
secure_messaging_confidentiality_key_identifierYes

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 behavioral burden. It clearly discloses that three separate keys are required, assigns roles to P0/E2/E1, and calls out that ISO_FORMAT_4 is unsupported. It does not mention the return value or failure modes, but the key and format constraints are well covered.

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 well structured with a clear call-to-action, important warning, key-type summary, and argument list. There is some redundancy between the 'Required key types' block and the Args section, but for a high-stakes cryptographic operation the repetition reinforces critical constraints without becoming rambling.

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 the complexity—7 required parameters, a nested object, no annotations, and no output schema—this description covers the essential decision points: when to call it, what prerequisites exist, and what each parameter means. The only notable gap is that it does not explicitly describe what the operation returns, which would be useful without an output schema.

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

Parameters4/5

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

Schema coverage is 0%, and the description compensates by explaining all seven parameters, including ARN/alias expectations and hex encoding. The main weakness is derivation_method_attributes, which is only described as 'Visa, Mastercard, etc.' rather than giving a precise structure or accepted values.

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 names a specific operation: generating an EMV PIN change MAC for issuer scripts, CHANGE REFERENCE DATA (INS=24), or offline PIN change MAC assembly. It also distinguishes itself from single-key EMV MAC helpers, making the tool's purpose and scope unambiguous.

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

Usage Guidelines5/5

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

Explicitly instructs when to use the tool: 'Call this before implementing any EMV PIN change flow.' It also states when it is not sufficient—single-key EMV MAC helpers (E2 only) cannot replicate this—and explains that all three key types must be provisioned in APC separately.

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