Skip to main content
Glama

parse_invoice

Read-onlyIdempotent

Extracts customs-ready line items from supplier invoices or packing lists, checks totals and weights, and suggests TN VED search queries for duty calculation.

Instructions

Parse a supplier's commercial invoice or packing list into customs-ready line items.

Extracts invoice number, date, parties, currency, Incoterms and country of origin, and for each line: description, model, material, supplier HS code, quantity, unit, price, amount, net and gross weight. Checks arithmetic (qty x price, sum vs total), explains what to add to the invoice value for customs value under the given Incoterms, and suggests a TN VED search query per line (HS code first 6 digits or Russian keywords). Feed the lines to tnved_search and calc_import_payments.

Input Schema

NameRequiredDescriptionDefault
file_urlNoPublic link to the invoice file: .xlsx/.csv are parsed directly; PDF/scans/DOCX go through DocParse when the server has it configured
invoice_textNoInvoice or packing list as Markdown or plain text, e.g. the output of DocParse. Tables with English, Chinese (品名, 数量, 单价, 金额, 净重) or Russian headers

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, non-destructive, open-world, so safety is covered. The description adds real value beyond that: it discloses arithmetic validation, an Incoterms-based customs value explanation, and per-line TN VED query suggestion — behaviors an agent couldn't infer from the schema. It doesn't mention behavior on unparseable or low-confidence files, which keeps it short of a 5.

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?

Front-loaded with the purpose, then the extracted-field list, then the derived behaviors, then the handoff. Dense but every clause carries information; the field enumeration is long but directly useful for verifying extraction quality.

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 only two optional parameters, no output schema, and full schema coverage, the description compensates well by enumerating the returned line fields and the derived checks. The only gap is the concrete response envelope (e.g. how warnings about arithmetic mismatches are surfaced).

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% and both parameters are documented in-schema, including the xlsx/csv vs PDF/DOCX routing. The description adds no parameter-level guidance of its own, 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 (parse a supplier's commercial invoice or packing list into customs-ready line items) and enumerates exactly what is extracted, so an agent can tell it apart from tnved_search or calc_import_payments immediately.

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 routes the agent downstream: 'Feed the lines to tnved_search and calc_import_payments', establishing this as the first step of a pipeline. It lacks an explicit when-not-to-use clause, but the extraction-then-classify framing is unambiguous.

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