Skip to main content
Glama
Xero MCP Safe

Xero MCP Safe

by dwadlane

Draft bill from a supplier document

bill_from_document
Idempotent

Extract supplier invoice fields from OCR text, validate GST in whole cents, and prepare a draft ACCPAY supplier bill, blocking mismatches or duplicates.

Instructions

Read the text of a supplier invoice (OCR style), extract the fields, check the GST maths in whole cents and propose a DRAFT supplier bill (ACCPAY). Deterministic parser by default; mode=claude is optional and sends the text to the Anthropic API. Dry run by default. If the GST does not add up, the supplier is unknown or the bill number already exists, it is blocked even with confirm=true. Created as DRAFT only, never approved.

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": {
      "text": "<text>"
    },
    "name": "bill_from_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNodeterministic
textYes
confirmNo
contact_idNoXero ContactID of the supplier, if the name on the document does not match

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare destructiveHint=false, idempotentHint=true, and openWorldHint=true, lowering the burden, but the description still adds real value: dry run by default, DRAFT-only creation that is never approved, and the blocking rules for GST mismatch, unknown supplier, or duplicate bill number. It also discloses that mode=claude sends the text to the Anthropic API, an important data-egress fact not captured by openWorldHint alone. Score reflects that safety semantics are clear while return/error shape and write-confirmation flow remain unstated.

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?

The purpose and the deterministic-by-default behavior are front-loaded, and each clause carries distinct information (validation rules, safety posture, blocking conditions). It is dense and runs as a single paragraph, but no sentence is filler.

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?

For a four-parameter mutation tool with no output schema, the description covers the important behavior: draft-only creation, dry run default, validation gates, and the external API call in claude mode. The remaining gap is what the caller receives (extracted fields, proposed bill identifiers, error detail), which the agent would benefit from knowing.

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 description coverage is only 25% (only contact_id is documented), so the description must compensate, and it does: it explains that mode selects a deterministic parser versus an Anthropic API call, that confirm defaults to off for dry run, and that text is OCR-style invoice text. The 60000 max length and the enum values are left to the schema, which is acceptable.

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?

The description opens with a specific verb chain and resource: reads supplier invoice text (OCR style), extracts fields, checks GST, and proposes a DRAFT ACCPAY supplier bill. It also implicitly separates itself from the sibling invoice_from_job by targeting supplier bills rather than job-derived invoices. An agent can identify the operation without opening the schema.

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?

It clearly states the default path (deterministic parser), the optional alternative (mode=claude), and the dry-run default, plus the exact conditions under which the call is blocked even with confirm=true. It does not explicitly name a sibling tool as an alternative for related flows, which keeps it just below a 5.

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