Skip to main content
Glama

Record a purchase invoice

record_purchase_invoice
Destructive

Records a supplier invoice (bill) against one purchase order, with its lines and charges. Returns the invoice id and sku_url.

Input Schema

NameRequiredDescriptionDefault
statusNounpaid, paid or partially_paid.
dry_runNoValidate only; saves nothing.
due_dateNo
currency_idNo
financial_linesNoPO charges: [{id, quantity, amount, link_type: App\Models\PurchaseOrder}].
idempotency_keyNoA repeat with this key replays the first result.
purchase_order_idYes
purchase_invoice_dateYesISO date.
purchase_invoice_linesNoLines: [{purchase_order_line_id, quantity_invoiced, unit_price (gross)}].
supplier_invoice_numberYesThe supplier's invoice number exactly as printed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already declare write, destructive, non-idempotent and closed-world, so the safety profile is largely covered. The description adds the return payload ("invoice id and sku_url"), which is useful since there is no output schema, but it omits permissions, side effects on the PO, and how dry_run/idempotency change behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no filler, with the operation and its scope stated first and the return value second. Every clause carries information the agent needs.

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 10-parameter destructive mutation it covers purpose and the return shape, which is more than many tools do. However it says nothing about preconditions, error behavior, or the dry-run/idempotency interplay, leaving real gaps for an agent invoking it unattended.

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?

With 70% schema description coverage, the schema already documents status, dry_run, idempotency_key, dates and the two line arrays. The description only loosely maps "lines and charges" to purchase_invoice_lines and financial_lines and adds nothing about due_date, currency_id, or which array carries what data.

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?

The description gives a specific verb and resource ("Records a supplier invoice (bill)") plus the scope constraint ("against one purchase order, with its lines and charges"), which is enough to distinguish it from create_purchase_order and record_vendor_credit. It does not explicitly name or contrast those siblings, so it falls short of a 5.

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?

It states a constraint (one PO per invoice) but gives no when-to-use context, no prerequisites such as the PO existing or being in a receivable state, and no guidance on choosing between this and the related record_vendor_credit tool. The agent must infer all routing decisions.

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.