Skip to main content
Glama

Map invoice lines from the buyer's goods receipt

apply_goods_receipt
DestructiveIdempotent

Changes data: reads the buyer's own goods receipt on a shipment (a document that list_documents shows with goods_receipt true: the pre-albaran the buyer keyed into its ERP from the supplier's invoice), pairs each of its rows with the invoice line it came from, and gives the line the article the buyer keyed, as the person who connected this app, recording it in the organization's audit log. That replaces the article the line had matched on its own and is learned: the supplier's code for that part is mapped to the article from then on. A line a person already confirmed with another article is left alone, a code already confirmed for another article is reported as a conflict and not replaced, and rows that pair with no line are skipped. The buyer's shipment number becomes the shipment's ERP reference when it has none. Use it only when the user asks to map a goods receipt, and say which document first. Only for an organization that keeps a product catalogue. Applying it again maps nothing more. Nothing is sent and no AI is called. Answers with how many rows paired, how many lines were mapped and how many conflicts. Get the document_id from list_documents.

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": {
      "document_id": "<document_id>"
    },
    "name": "apply_goods_receipt"
  }
}

Input Schema

NameRequiredDescriptionDefault
document_idYesA document id such as "doc_45", as returned by list_documents.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses that the existing article match is replaced, that the mapping is learned for future use, that a user-confirmed article is left untouched, that conflicting codes are reported rather than replaced, that unmatched rows are skipped, that the shipment ERP reference may be set, that the action is written to the audit log, and that nothing is sent or AI-processed. This is consistent with destructiveHint=true and idempotentHint=true ('Applying it again maps nothing more').

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 mutation warning and the core action, and nearly every clause carries operational meaning (conflict handling, idempotency, audit logging). It is dense and runs long in single sentences with embedded parentheticals, which costs some readability, but there is little filler to cut.

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?

For a single-parameter mutation with no output schema, the description covers preconditions, side effects, conflict and skip behavior, idempotency, and even the return shape (rows paired, lines mapped, conflicts). Nothing an agent needs to invoke it correctly is missing.

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% for the single `document_id` parameter, so the schema already carries its meaning and format. The description adds the useful sourcing pointer that the id comes from list_documents, which reduces lookup errors, but adds no further constraints on the value itself.

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?

Opens with a mutation signal ('Changes data') followed by a precise verb chain: reads the buyer's goods receipt, pairs rows with invoice lines, and assigns the buyer-keyed article. It distinguishes itself from list_documents by defining the document type that sibling flags with `goods_receipt` true, so an agent can tell the two apart without opening either 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?

Gives explicit exclusions ('Use it only when the user asks to map a goods receipt'), prerequisites ('Only for an organization that keeps a product catalogue'), and a routing instruction to get `document_id` from list_documents. It does not name a competing sibling for the same goal, but the when-to-use and when-not-to-use conditions are stated clearly.

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.

Resources