Skip to main content
Glama

SAF-T Parser API - Audit File to JSON, Ledger Check

saft_parser
Read-onlyIdempotent

Parse SAF-T (Standard Audit File for Tax) XML from Portugal, Norway, Luxembourg, Poland, Lithuania and other EU/EEA countries into structured JSON: company and tax ID, fiscal period, customers, suppliers, chart of accounts, tax codes, general-ledger transactions, sales and purchase invoices. Verifies debit = credit and stated control totals and entry counts, and returns structured numeric totals (ledger debit/credit, sales net/VAT/gross) plus top customers from the full file. XXE-safe deterministic parsing, zero AI, nothing stored. Usable from AI agents via MCP. Free: 5 calls/day per IP. Paid: Radar API key (from €15/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.01/call via x402 at https://radarbg.com/x402/saft-parser.

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of rows to return per table (1-2000).
contentNoRaw SAF-T XML string. Provide either content or fileBase64.
fileNameNoOptional original XML filename.
fileBase64NoBase64-encoded SAF-T XML file (alternative to content, max 15 MB).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Despite readOnlyHint=true and idempotentHint=true already present, the description adds real substance: XXE-safe deterministic parsing, zero AI, no storage of the file, and the free/paid quota model. Authentication mechanics (X-API-Key via Radar, or x402 per-call payment) and the 5 calls/day free tier are disclosed, which an agent needs to know before invoking. It does not describe error behavior for malformed or unsupported-country XML, which is the main remaining gap.

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 capability sentence is front-loaded and information-dense, followed by short scoping, validation, safety and pricing sentences that each carry a distinct fact. The pricing URL and per-call price are slightly promotional but genuinely actionable for auth decisions, so little is wasted.

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?

There is no output schema, yet the description enumerates the returned sections (company/tax ID, fiscal period, customers, suppliers, chart of accounts, tax codes, GL transactions, invoices) and the aggregate results (ledger debit/credit, sales net/VAT/gross, top customers) plus validation outcomes. For a single-purpose parser with fully documented parameters, this is sufficient to call it 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%, so all four parameters (limit, content, fileName, fileBase64) are already documented in the schema. The description adds only an indirect hint about full-file aggregation ('top customers from the full file'), which touches on the limit parameter without explaining it. Baseline 3 is appropriate.

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 ('Parse SAF-T ... XML ... into structured JSON') and enumerates exactly which sections are extracted. It also names the country scope (PT, NO, LU, PL, LT and other EU/EEA), which cleanly separates it from sibling format parsers like jpk_vat_parser or fatturapa_parser that handle different schemas.

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?

Usage context is clear: send SAF-T XML from the listed jurisdictions and get JSON plus control-total validation. The country/format scoping implicitly routes the agent away from other national-format parsers, but there is no explicit 'use X instead when' statement or guidance on when the verification output vs. the parsed rows matter.

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