Skip to main content
Glama

IDNTEQ tools

DGI / CPS perso decoder

emv_dgi_decode
Read-onlyIdempotent

Decodes personalization data as Data Grouping Identifiers (EMV Card Personalization Specification v1.0 §2.2 and Annex A): DGI (2 bytes), length (1 byte, or FF and 2 bytes) and data, in plain framing or with an 8802 marker before each DGI. Names the common DGIs of CPS Annex A (record DGIs 01nn–1Enn, 8000 DES keys, 9000 key check values, 8010 reference PIN, 9010 PIN counters, 81xx–83xx ICC key parts, 9102 SELECT data, 9104 GPO data) and decodes their TLV content with EMV tag names. Encrypted DGIs (first byte 80–8F, CPS §2.2) are hidden unless reveal_encrypted is set. Optionally checks the presence of the CPS common DGIs. Scheme-specific DGIs are not named. Contains key material and card data. Use test keys and test data only.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "data": "0101 10 70 0E 5A 08 4000 0000 0000 0002 5F34 01 00  9102 0C A5 0A 50 08 5445535420415050  9104 0A 82 02 5C00 94 04 08010100  8000 10 00112233445566778899AABBCCDDEEFF  9000 03 08D7B4",
      "checklist": "cps-payment"
    },
    "name": "emv_dgi_decode"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataYesThe DGI stream as hex (spaces allowed).
framingNoplain: DGI | length | data. marked: 8802 before each DGI. auto: marked when the stream starts with 8802 and parses that way.auto
checklistNoPresence checklist of the CPS Annex A common DGIs: payment application or PSE.none
reveal_encryptedNoShow the data of encrypted DGIs (80xx–8Fxx); hidden by default.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive, closed-world behavior, and the description adds real context beyond them: encrypted DGIs are masked by default, the exact DGI families that will be named, and the warning that output contains key material and card data requiring test keys. It stops short of describing parse-failure behavior or how partial/garbage streams are reported.

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?

Front-loaded with the decode definition before the enumeration of named DGIs, and every clause carries information about format, coverage, or safety. It is a single dense paragraph with the long parenthetical DGI list slightly impeding scanability.

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

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, yet the description says precisely what the agent gets back: the DGI name, its length framing, and decoded TLV children with EMV tag names, plus what is masked. Combined with a full-coverage schema and a worked example, an agent has everything needed to call this correctly.

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% and each parameter is already documented with defaults and enums, so the baseline is 3. The description reinforces reveal_encrypted semantics (hidden unless set) and that the checklist covers CPS common DGIs, but adds no syntax or format detail the schema lacks.

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?

States a specific verb and resource ("Decodes personalization data as Data Grouping Identifiers") and pins the exact wire format (2-byte DGI, 1-byte length or FF+2 bytes, optional 8802 marker), which is enough to tell it apart from the TLV-level siblings without reading the schema.

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?

Gives concrete operating context: use when the input is CPS DGI-framed perso data, set reveal_encrypted to see 80–8F DGIs, and enable a checklist to verify CPS Annex A common DGIs. It also states a scope boundary ("Scheme-specific DGIs are not named") and a test-data caveat, but never explicitly routes to an alternative such as emv_tlv_decode for raw TLV.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources