Skip to main content
Glama
cmendezs

mcp-invoicenow-sg

validate_invoice_sg

Validate UBL 2.1 invoices against IRAS's C5 acceptance-layer Schematron to identify documents IRAS would reject, e.g., missing buyer/seller UEN.

Instructions

Validate a UBL 2.1 XML invoice against IRAS's C5 acceptance-layer Schematron.

Runs IRAS's own C5 acceptance layer (checks documents that IRAS itself would still reject, e.g. a missing buyer/seller UEN). The CEN EN16931 base ruleset, PINT-SG's own jurisdiction overlay, and SG Peppol BIS Billing 3.0 are NOT checked — see scope and the EN16931-BASE-UNAVAILABLE warning in the result, and validators/schematron.py's module docstring for why (SGInvoice's GST category codes have no sourced crosswalk to the UNCL5305 code list the base ruleset requires; tracked as [CORE-EN16931-BASE-SG-CROSSWALK-1]).

Requires the optional xslt2 extra (pip install mcp-invoicenow-sg[xslt2]) — the bundled stylesheet needs XSLT 2.0. If missing, returns level="unavailable".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xml_contentYesUBL 2.1 Invoice or CreditNote XML content to validate.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.2/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and meets it: it discloses the dependency on the optional xslt2 extra, that a missing install returns level="unavailable", and that results carry a scope field and an EN16931-BASE-UNAVAILABLE warning. Failure modes and known limitations are surfaced before the agent calls.

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 scoping is reasonably front-loaded, but the second paragraph leaks implementation detail unhelpful to an agent: a reference to validators/schematron.py's module docstring and the internal ticket [CORE-EN16931-BASE-SG-CROSSWALK-1]. Those sentences consume space without changing invocation behavior.

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?

An output schema exists, so return values need not be exhaustively explained, and the description still usefully names key result fields (scope, level, the warning code). For a one-parameter validation tool the coverage is adequate; only the alternative-tool routing for the uncovered rulesets is missing.

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% for the single xml_content parameter, whose schema text already specifies 'UBL 2.1 Invoice or CreditNote XML content to validate.' The description restates UBL 2.1 invoice XML but adds no format, encoding, or size guidance beyond the schema, so the baseline 3 applies.

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 — validate a UBL 2.1 XML invoice against IRAS's C5 acceptance-layer Schematron — and immediately scopes what that means (IRAS's own acceptance layer, e.g. missing buyer/seller UEN). This is distinguishable from the sibling generate_invoice_sg and the various codelist/lookup tools.

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?

Explicitly defines when this tool applies (IRAS acceptance-layer checks) and, more usefully, when it does not: the CEN EN16931 base ruleset, PINT-SG overlay, and SG Peppol BIS Billing 3.0 are NOT checked. That negative scoping is strong routing guidance, though it never names an alternative tool for the unchecked rulesets.

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