Skip to main content
Glama

GCC e-Invoice Preflight Oracle

Build a ZATCA QR (TLV) payload

zatca_qr_encode
Read-onlyIdempotent

Encode the five phase-1 fields (plus optional phase-2 hash/signature/key tags) into the base64 TLV string that goes into the QR image and the UBL QR reference. Free. Response: result with verdict (ACCEPTED | ACCEPTED_WITH_WARNINGS | REJECTED), findings[] (id, severity, message, fields, location, fix_hint, source = xsd | schematron | preflight), counts, ruleset version and timings, plus data_confidence, estimated_items[], sources[], data_version, warnings[] and a disclaimer. Documents are validated in memory and never stored or logged.

Input Schema

NameRequiredDescriptionDefault
timestampYesISO 8601, e.g. 2026-10-31T14:05:00Z
vat_totalYese.g. '150.00'
public_keyNoBase64 (phase 2).
vat_numberYesKSA VAT number: 15 digits, starts and ends with 3.
seller_nameYes
invoice_hashNoBase64 SHA-256 of the invoice (phase 2).
total_with_vatYese.g. '1150.00'
ecdsa_signatureNoBase64 (phase 2).
certificate_signatureNoBase64 (phase 2, simplified invoices).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds meaningful context beyond them: the operation is free, encoding is done in memory, and nothing is stored or logged. That privacy/cost disclosure is the kind of thing annotations cannot express. It does not, however, explain what happens with malformed phase-2 inputs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose sentence is excellent and front-loaded, but the bulk of the text enumerates return fields (verdict, findings[], counts, data_confidence, sources[], data_version, timings) that an output schema already covers. Worse, the xsd/schematron/ruleset 'documents are validated' phrasing reads as copied from a validation tool and dilutes focus.

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?

With an output schema present, the description need not explain returns, and it covers purpose, cost, and data-handling well. It is slightly incomplete in not clarifying how the optional phase-2 parameters interact with the required phase-1 set, or what an encoding failure looks like.

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 already 89%, so the baseline is 3, but the description adds real semantic structure by distinguishing the five mandatory phase-1 fields from the optional phase-2 hash/signature/key tags. It does not map names to the phase groupings explicitly, and seller_name has an empty schema description.

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+resource (encode TLV fields into a base64 TLV string) and even names the destination artifacts (QR image, UBL QR reference). The encode/decode split against sibling zatca_qr_decode is unambiguous without comparing schemas.

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

Usage Guidelines3/5

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

The description implies its use case (producing the QR payload) and notes it is free, but never states when to pick this over zatca_qr_decode, validate_invoice, or the other siblings, nor any precondition such as needing phase-2 keys for the optional tags. Usage is inferable but not guided.

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