Skip to main content
Glama

validate_invoice

Validates invoice XML against ZATCA business rules, checking required fields, VAT numbers, mathematical accuracy, and UBL 2.1 structural integrity.

Instructions

Validate an invoice XML against ZATCA business rules.

Runs comprehensive checks including: required fields, VAT number format, mathematical accuracy of line totals and VAT calculations, and structural integrity of the UBL 2.1 XML.

Args: invoice_xml: Complete UBL 2.1 XML invoice string to validate

Returns: JSON with is_valid (boolean), errors (list of issues), warnings (list), and checks_run (number of rules checked)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoice_xmlYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries full behavioral disclosure. It accurately describes the read-only nature of validation and details the return structure (is_valid, errors, warnings, checks_run). However, it does not mention synchronous/asynchronous execution or potential timeouts for large payloads, which are minor omissions.

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 concise and well-structured: a one-sentence summary followed by bullet points and fully documented arguments/returns. Every sentence adds value without redundancy.

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?

Given the simple one-parameter input and the presence of an output schema (providing full return structure), the description covers all necessary aspects: what the tool does, what it validates, and exactly what it returns. No gaps are evident.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description compensates for 0% schema coverage by fully describing the single parameter 'invoice_xml' with format (UBL 2.1 XML) and completeness expectation. This adds significant meaning beyond the schema's type-only definition.

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 clearly states the tool validates an invoice XML against ZATCA business rules, specifying the exact scope (comprehensive checks including required fields, VAT format, math accuracy, and UBL 2.1 structure). It uniquely identifies this tool among siblings, as no other sibling is dedicated to validation.

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 usage for post-generation/signing validation but lacks explicit guidance on when to use this tool versus alternatives (e.g., 'check_compliance') or when not to use it. No context on prerequisites or exclusions is provided.

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

Install Server

Other Tools

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/DoubleH10/zatca-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server