Skip to main content
Glama

Validate e-invoice

vn_einvoice_validate
Read-onlyIdempotent

Validates e-invoice objects against Decree 123/2020 mandatory fields, including series, issue date, seller tax ID, line items, and VAT rates 0/5/8/10/KCT/KKKNT.

Instructions

Validate an e-invoice (hóa đơn điện tử) object against the mandatory contents of Decree 123/2020 (series, date, seller tax ID, lines, VAT rates 0/5/8/10/KCT/KKKNT).

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": {
      "invoice": "<invoice>"
    },
    "name": "vn_einvoice_validate"
  }
}

Input Schema

NameRequiredDescriptionDefault
invoiceYesInvoice object: {series, issueDate, seller{name,taxId,address}, buyer{...}, lines[{name,quantity,unitPrice,vatRate}]}

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already establish readOnly, idempotent, non-destructive, closed-world behavior, so the safety profile is covered. The description adds real domain value by naming the regulation and the enumerated VAT rates being checked. It does not say what a failing validation produces (error list vs boolean) or whether errors are aggregated, which matters for a validator with no output schema.

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?

A single front-loaded sentence with the verb and resource first, no filler wording. The parenthetical Vietnamese gloss and the field list make it dense but each element carries information; only slight cost is readability of one long clause.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only single-parameter validator this is nearly sufficient, and the rule set is well specified. The notable gap is the response contract — with no output schema, the description should indicate whether the result is a pass/fail verdict or a list of field-level violations, since that determines how an agent reacts.

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 100% and the nested invoice object is documented, so baseline would be 3. The description goes further by enumerating the permitted vatRate values (0/5/8/10/KCT/KKKNT), which the schema lists only as a bare 'vatRate' field with no enum constraint, and by naming the mandatory fields actually enforced.

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 (validate) and resource (e-invoice object), plus the exact rule set applied (Decree 123/2020 mandatory contents) and the fields checked. This clearly separates it from siblings like vn_einvoice_totals, vn_einvoice_vat, and vn_tax_id_validate, which each target a narrower aspect.

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?

Usage is only implied: it is a compliance check, so an agent can infer it should be called before issuing or submitting an invoice, or before using vn_einvoice_mock_issue. There is no explicit when-to-use or when-not-to-use guidance, and no statement of how it relates to the VAT-only or totals siblings.

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