Skip to main content
Glama
ERP Procurement MCP Server

ERP Procurement MCP Server

Three-way match an invoice

match_invoice
Read-only

Runs three-way matching on an invoice against its purchase order and goods receipts, validating supplier, currency, duplicates, price tolerance, and quantities. Returns matched or a list of exceptions.

Instructions

Checks an invoice against its purchase order and goods receipts: supplier, currency, duplicate invoice number, lines on the PO, unit price within the tolerance set by finance, quantity ordered and quantity received. Returns "matched" or a list of exceptions.

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": {
      "invoiceId": "<invoiceId>"
    },
    "name": "match_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
invoiceIdYesInternal invoice id, for example INV-1001

Output Schema

NameRequiredDescriptionDefault
poIdYes
statusYes
invoiceIdYes
exceptionsYes
invoiceTotalYes
priceTolerancePctYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, and the description adds meaningful behavioral detail: supplier, currency, duplicate invoice number, PO lines, price tolerance, ordered quantity, and received quantity are all checked. It also summarizes the outcome as 'matched' or exceptions, though it does not explain missing-PO/receipt handling or tolerance configuration beyond 'set by finance'.

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, front-loaded with purpose and followed by the return outcome. The checklist is compact and every phrase contributes useful matching criteria or result information.

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 read-only three-way match tool with one required ID and an output schema, the description covers what is checked and the shape of the result. It is nearly complete, with only minor gaps around edge cases such as missing PO/receipt data or configuration of the finance tolerance.

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?

There is one parameter, invoiceId, and schema description coverage is 100% with a pattern and example. The description adds no parameter-level syntax or constraints beyond what the schema already provides, so the baseline 3 is appropriate.

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 ('Checks') and resource ('invoice against its purchase order and goods receipts'), then enumerates the exact validation points. The purpose is clearly a three-way match rather than a lookup or workflow action, though it does not explicitly name sibling alternatives.

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

Usage Guidelines3/5

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

Usage is implied by the description: this is the validation step for an invoice against PO and receipts. However, it gives no explicit when-to-use guidance, exclusions, or alternatives such as get_invoice, search_invoices, or request_approval.

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