Skip to main content
Glama

Compute e-invoice totals

vn_einvoice_totals
Read-onlyIdempotent

Validate an e-invoice and compute line amounts, VAT per rate, grand total, and the total in Vietnamese words.

Instructions

Validate an invoice and compute line amounts, VAT per rate, grand total and the total in Vietnamese words.

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_totals"
  }
}

Input Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the safety profile is covered. The description adds that the tool performs validation as well as arithmetic, but does not disclose what happens when the invoice is invalid (error vs partial result), nor any assumptions about rounding on per-rate VAT.

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 no filler. Slightly dense in its output enumeration but every clause names a distinct computed value.

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?

The description does cover the shape of the result (line amounts, VAT per rate, grand total, words), which matters since there is no output schema. However, for a tool with a nested invoice object and an undocumented enum parameter, the lack of rounding rules, validation-failure behavior and 'thousand' semantics leaves real gaps.

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

Parameters2/5

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

Schema description coverage is 50%, and the description adds no parameter meaning at all. The unlabeled 'thousand' enum ('nghìn' vs 'ngàn') is the classic dialect choice for how 'thousand' is rendered in the words output, yet neither schema nor description explains it. The nested invoice object is only enumerated in the schema, not clarified in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource: 'Validate an invoice and compute line amounts, VAT per rate, grand total and the total in Vietnamese words.' The scope of outputs is enumerated precisely. It does not, however, distinguish itself from siblings like vn_einvoice_validate or vn_einvoice_vat, whose names suggest overlapping validation and VAT behavior.

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

Usage Guidelines2/5

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

No guidance on when to use this versus vn_einvoice_validate (also validates) or vn_einvoice_vat (also computes VAT). The phrase 'validate an invoice' implies a precondition but never states whether validation failures abort the computation or are reported alongside totals.

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