Skip to main content
Glama

hsm_analyze_code

Scan legacy payment code for HSM socket calls, detect Futurex, Thales, and Atalla commands, and receive APC migration paths and notes for LMK, DUKPT, and fixed-key patterns.

Instructions

Call this whenever reviewing legacy payment code that may contain HSM socket calls — Python, Java, C, Go, or any language. Even a single file or function is worth scanning. Works without AWS credentials.

Detects Futurex Excrypt commands ([AOCCCC;...] frames), Thales/International 2-char command codes, and Atalla/Futurex Standard numeric codes. Returns identified commands, their APC migration path, and migration notes for LMK, DUKPT, and fixed-key patterns.

Args: source_code: Raw source code containing HSM socket calls or command strings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_codeYes

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 provided, the description carries the full behavioral burden and largely delivers: it discloses that no AWS credentials are required, enumerates the exact command formats detected, and states the three output categories. It stops short of disclosing whether the supplied source code is processed locally or transmitted externally, and says nothing about size limits — meaningful traits for a tool that ingests raw code.

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 the usage trigger, then moves through scope, auth, detection capabilities, and returns — a logical order with zero filler. The Args section cleanly separates parameter definition from behavioral prose. Every sentence contributes distinct information, so the length is fully earned.

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 one-parameter analysis tool with no output schema, the description covers the essentials: trigger conditions, input format, detection scope, and a qualitative account of return values (identified commands, APC migration path, migration notes). It omits the no-match behavior and any output structure, which an agent may need when branching on results — strong, but not exhaustive.

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 description coverage is 0%, so the description must compensate, and its Args section defines source_code as 'Raw source code containing HSM socket calls or command strings,' adding both type and relevance guidance. The main body adds language and scale guidance (any language, single file/function suffices). With only one parameter, this level of detail is sufficient for correct invocation.

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 opening line states a precise trigger and resource: analyzing legacy payment code for HSM socket calls, with explicit language coverage. It differentiates itself from the closest siblings by input type — raw source code rather than a discovery log (hsm_analyze_discovery_log) or a single command lookup (hsm_lookup_command). The detection targets and return values are concrete, so an agent knows exactly what this tool 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?

'Call this whenever reviewing legacy payment code that may contain HSM socket calls' is an explicit when-to-use trigger, reinforced by the low-cost signal 'Even a single file or function is worth scanning.' However, it never names sibling alternatives or when-not-to-use cases, so the agent must infer the boundary with hsm_analyze_discovery_log and hsm_migration_notes from context rather than being told.

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