Skip to main content
Glama
ebcdicjp-mcp

ebcdicjp-mcp

by yukijames25

read_records

Decode Japanese mainframe EBCDIC records with a COBOL copybook into nested JSON, reporting unmapped bytes, gaiji, broken SO/SI, and invalid packed or zoned numbers by field path and byte offset.

Instructions

Decode records of a Japanese mainframe data file (fixed-length, or variable with RDW) using a copybook. Returns nested JSON per record plus issues located by field path and byte offset (pos is 1-based): unmapped bytes, 外字 (gaiji, shown as 〓), broken SO/SI, invalid packed/zoned numbers. Code page and RDW are detected unless given; read the notes. Read a few records first (limit).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>",
      "copybook": "<copybook>"
    },
    "name": "read_records"
  }
}

Input Schema

NameRequiredDescriptionDefault
rdwNoRDW variable-length records; omit to detect
useNoREDEFINES readings to use: ["ADDR-JP"] for every record, or by record type: ["HOJIN-DETAIL:TOR-KBN=1", "KOJIN-DETAIL:TOR-KBN=2"]; the other readings are omitted
pathYesAbsolute path to the data file
skipNo
limitNo
lreclNo
recordNo
codepageNoibm930 = katakana in single-byte (no lowercase); ibm939 = Latin with lowercase. auto detects it and says what it assumed in notes.auto
copybookYesAbsolute path to the COBOL copybook
copybook_encodingNoauto = UTF-8, else Shift_JIS (cp932)auto

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/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 substantial work: it discloses the return shape (nested JSON per record), the diagnostic model (issues keyed by field path and 1-based byte offset), and enumerates specific problem classes (unmapped bytes, gaiji shown as 〓, broken SO/SI, invalid packed/zoned numbers). It does not state file-access requirements or behavior on very large files, but the read-only nature is evident from the name.

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?

Purpose is front-loaded in the first sentence, followed by return-value and diagnostic detail, with the practical limit tip last. The parenthetical stacking ('fixed-length, or variable with RDW', 'pos is 1-based', 'gaiji, shown as 〓') is dense but each item is informative rather than filler.

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 10-parameter tool with no annotations and no output schema, the description covers the two heaviest burdens: what comes back (nested JSON records plus located issues) and how encoding/RDW is resolved. The remaining gap is the meaning of lrecl, record, and skip, which an agent must infer.

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 coverage is 60%, and the description reinforces detection semantics for rdw and codepage plus a usage hint for limit, so it matches the baseline rather than exceeding it. It adds nothing for the three undocumented parameters — lrecl, record, and skip — which are exactly where the schema is silent and the agent most needs meaning.

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 states a concrete verb and resource — decode records of a Japanese mainframe data file with a copybook — and pins the scope to fixed-length or RDW variable-length files. That scope is narrow enough to separate it from decode_bytes (raw bytes) and describe_layout without naming them.

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 an actionable operational rule — 'Read a few records first (limit)' — and tells the agent that codepage and RDW are auto-detected and that notes should be read. It stops short of explicit when-not guidance and never says whether to call detect_codepage separately or when to prefer decode_bytes.

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