Skip to main content
Glama

Receive Purchase Order

receive_purchase_order
Destructive

Receive a delivery against an issued purchase order, line by line — the Receiving page. For each line give the units that arrived (partial is fine) and, for a short shipment, the units to record as missing. Received units go into stock at the item's default location or a location you name, with lot / expiry / serials for tracked items; cost layers, the receiving journal entry and backorder release happen as in the UI. Receiving more than was ordered needs confirmOverReceive=true and is only possible when the tenant allows over-receiving. The preview shows ordered, already received, receiving now and remaining per line, plus the base-unit quantity and cost that land in stock. Two-step: preview=true, then commit with the previewReceipt. Call get_purchase_order_receiving first for lineIds. Omit lines to receive everything still open on every line ("it all arrived") into each item's default location; tracked items still need their lot or serials, so name those lines. A draft order must be issued before it can be received.

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": {
      "purchaseOrder": "<purchaseOrder>"
    },
    "name": "receive_purchase_order"
  }
}

Input Schema

NameRequiredDescriptionDefault
linesNoLines to receive (max 200). All lines commit together or not at all. Omit (or pass an empty list) to receive every remaining unit on every line.
previewNoStep 1 of the required two-step write: set true to validate and receive a structured preview plus a single-use previewReceipt. Nothing is received until the commit call.
receiptInputNoEcho the receiptInput returned by preview on commit and retries. It is hash-bound to the receipt; do not edit it.
purchaseOrderYesPurchase order id (GUID), document number (e.g. PO-2026-10-000118), or the short form people use for an open order: its last digits ("118", "PO 118").
idempotencyKeyNoCaller-generated idempotency key; required with previewReceipt to commit.
previewReceiptNoStep 2: the receipt returned by the preview call. Supply with a fresh idempotencyKey to commit.
confirmOverReceiveNoSet true only after the user agreed to receive more than was ordered on a line.

Output Schema

NameRequiredDescriptionDefault
okNo
previewNo
warningsNo
expiresAtNo
statusAfterNo
actionItemIdNo
confirmationNo
receiptInputNo
correlationIdNo
linesReceivedNo
approvalResultNo
idempotencyKeyNo
previewReceiptNo
purchaseOrderIdNo
idempotentReplayNo
linesMarkedMissingNo
purchaseOrderNumberNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare destructive=true and non-idempotent, and the description goes well beyond that: it discloses that cost layers, the receiving journal entry and backorder release are triggered, that received units land in the default or named location, that tracked items require lot/expiry/serials, and that lines commit all-or-nothing. The two-step preview/commit mechanism and the preview's contents (ordered, received, now, remaining, base-unit qty and cost) are exactly the behavioral context an agent needs before a destructive write.

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?

Purpose and default behavior are front-loaded, and each sentence carries operational content rather than filler. It is a dense single block that repeats the over-receive rule (also encoded in confirmOverReceive) and the default-location behavior (also in the lines schema), which costs some efficiency.

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 destructive, multi-step write with nested line objects, the description covers the prerequisites, the two-step protocol, defaults, tracked-item requirements, over-receiving policy, and the draft-order gate. An output schema exists, so no return-value explanation is required, and nothing an agent needs before calling correctly appears 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%, so the baseline is 3, but the description adds procedural meaning the schema cannot: the required ordering of preview and previewReceipt, the idempotencyKey pairing on commit, and the semantic of omitting lines ('it all arrived') plus why tracked lines must still be named. It largely restates the over-receive and default-location rules already in the property descriptions, so it falls short of a 5.

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 and resource ('Receive a delivery against an issued purchase order, line by line') and anchors it to a concrete UI surface ('the Receiving page'). It is clearly distinguishable from siblings like get_purchase_order_receiving (read-only lookup, named as a prerequisite) and issue_purchase_order (required before receiving a draft).

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?

It gives explicit routing and preconditions: call get_purchase_order_receiving first for lineIds, run preview=true then commit with the previewReceipt, issue a draft order before receiving, and set confirmOverReceive=true only when the tenant permits over-receiving and the user agreed. It also states the omitting-lines shortcut and its exception for tracked items, so the agent knows which path to take.

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