Skip to main content
Glama

Parse one incoming invoice

parse_invoice

Reads ONE incoming supplier invoice and returns a job id for polling.

Use when: the user has a single invoice (PDF, photo, scan, XML e-invoice or QR bill) and wants supplier, invoice number, dates, amounts, VAT or line items extracted. Do not use when: the user asks to ISSUE an invoice, to send a payment, or to post entries into DATEV/1C — this tool only reads documents. For several documents call it once per document; the returned job ids can be polled independently.

Side effects and cost: the document is downloaded and queued. XML and QR invoices are parsed by code and cost nothing; scans and photos cost 0.07 EUR per page, charged to the prepaid balance. Not idempotent: each call creates a new job and a new charge for scans.

Parameter interactions and edge cases: the same file parsed twice returns the existing job with charged=false instead of billing twice, so retrying after a client timeout is safe — and the second call's country is ignored, the first profile wins. Per API key there is a request rate limit and a cap of 3 parses in flight; exceeding either returns 429 with Retry-After, which is a throttle, not a billing error. country changes field names and tax checks, never the price.

Returns: {ok, job_id, status}. Next step: call get_result with that job_id.

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": {
      "file_url": "<file_url>"
    },
    "name": "parse_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
api_keyNoDueBuddy API key (starts with dd_). Omit it when the server was added with an X-Api-Key header or DUEBUDDY_API_KEY is set; the call returns api_key_required when no key is available anywhere.
countryNoTwo-letter parsing profile that selects field names and tax rules: de, fr, it, pl, ru, kz, by, us, ae, sa, ua, ge. Defaults to de. Does not change the price; a wrong profile returns plausible but mislabelled fields.de
file_urlYesPublic https URL of exactly ONE invoice file hosted on duebuddy.work, for example https://duebuddy.work/files/invoice-218.pdf. Allowed endings: .pdf, .jpg, .jpeg, .png, .xml, .xlsx, .xls, .csv. http links and other hosts are rejected with an error; upload the file in the DueBuddy cabinet first to get a link.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / api_key / description
      Added value: +"DueBuddy API key (starts with dd_). Omit it when the server was added with an X-Api-Key header or DUEBUDDY_API_KEY is set; the call returns api_key_required when no key is available anywhere."
    • addedInput schema / properties / country / description
      Added value: +"Two-letter parsing profile that selects field names and tax rules: de, fr, it, pl, ru, kz, by, us, ae, sa, ua, ge. Defaults to de. Does not change the price; a wrong profile returns plausible but mislabelled fields."
    • addedInput schema / properties / file_url / description
      Added value: +"Public https URL of exactly ONE invoice file hosted on duebuddy.work, for example https://duebuddy.work/files/invoice-218.pdf. Allowed endings: .pdf, .jpg, .jpeg, .png, .xml, .xlsx, .xls, .csv. http links and other hosts are rejected with an error; upload the file in the DueBuddy cabinet first to get a link."
  2. Changed2 schema fields changed
    • addedInput schema / properties / api_key / default
      Added value: +""
    • changedInput schema / required
      Previous value: -[
      -  "api_key",
      -  "file_url"
      -]New value: +[
      +  "file_url"
      +]
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Goes well beyond the supplied annotations by disclosing per-page pricing (0.07 EUR for scans/photos, free for XML/QR), prepaid balance charging, a download-and-queue side effect, concurrency caps, and 429/Retry-After throttling. The only blemish is mild internal tension: it declares "not idempotent" yet also says re-parsing the same file returns the existing job with charged=false, which leaves the caller to infer that deduplication is content-based rather than per-call.

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?

Well front-loaded and clearly sectioned with labeled blocks (Use when / Do not use when / Side effects and cost / Parameter interactions / Returns), so an agent can scan it. It is on the long side for a 3-parameter tool, and the "not idempotent" claim partially restates and partly clashes with the deduplication paragraph.

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?

Despite having no output schema, the description specifies the return shape {ok, job_id, status} and the exact next call. For a paid, rate-limited, asynchronous tool it covers cost, failure modes (429 + Retry-After as throttle not billing error), edge cases, and billing behavior, leaving nothing critical unstated.

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%, so the baseline is 3; the description adds value by explaining that country swaps field names and tax checks but never the price, and that on a duplicate call the second call's country is ignored because the first profile wins. File URL and api_key semantics are left to the schema, which already documents them thoroughly.

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?

"Reads ONE incoming supplier invoice and returns a job id for polling" gives a specific verb, resource, cardinality (ONE), and return value. It explicitly disambiguates from issuing invoices, sending payments, and posting to DATEV/1C, so an agent can distinguish it from siblings like get_result without opening a schema.

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

Usage Guidelines5/5

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

Provides explicit "Use when" conditions enumerating the document types and fields extracted, plus a "Do not use when" block naming the out-of-scope intents. It also routes batch usage (call once per document) and the follow-up step (get_result with the job_id).

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.