Skip to main content
Glama

ERP: Record a purchase from a supplier

erp_purchase_record
Destructive

Record a PURCHASE of goods from a supplier that already arrived: a purchase order, its confirmation and the goods receipt into the warehouse — the stock GROWS; each purchase price becomes the item's cost (update_cost=false keeps the old cost). Use for «прийшла закупка від …», «купив у постачальника …», «внеси закупку». 'supplier' = the supplier's name (a new name creates the supplier, the card says so); each line: 'item' as written, 'quantity', 'cost' = the purchase price of ONE unit. 'date' YYYY-MM-DD if not today («позавчора» → compute the date). 'supplier_document' = their invoice / waybill number, if said. Items not in the catalog are refused (create them with erp_product_create first). A supplier's invoice as a PDF / photo goes through purchase_invoice_create_from_file instead. The same purchase twice is refused (again_ref only for a second identical delivery). Proposed write: one card with every line and stock before → after. CONFIRMATION: this tool is PROPOSED, never performed directly. You get status='confirmation_required' with an action_id and a plan_token, and the write happens only after confirm_action.

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": {
      "lines": "<lines>"
    },
    "name": "erp_purchase_record"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateNo
linesYes
totalNo
currencyNo
supplierNo
again_refNo
warehouseNo
supplier_idNo
update_costNo
new_supplierNo
supplier_documentNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare destructiveHint=true and openWorldHint=false; the description adds the far more important behaviour: the call is a PROPOSAL that returns status='confirmation_required' with action_id and plan_token and is only written after confirm_action. It also discloses side effects (stock grows, purchase price becomes item cost, update_cost=false preserves the old cost), the duplicate-refusual rule, and the refusal for unknown catalog items — all beyond what the annotations state.

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-loads the core action and stock effect, then param semantics, then refusals, then the confirmation protocol — a logical order with no filler sentences. It is dense and long with heavy capitalisation and mixed-language examples, but each clause carries operational information rather than restating the title.

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 an 11-parameter destructive write with no output schema, the description covers the confirmation handshake, duplicate handling, catalog preconditions and cost propagation, which is the critical context. The remaining gap is the unexplained subset of parameters (warehouse, supplier_id, total, currency, new_supplier) and no note on the 30-line cap or required lines.

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 0%, so the description must carry parameter meaning and it does for the load-bearing ones: supplier (name creates a new supplier), lines.item/quantity/cost (cost = price of ONE unit), date format and relative-date computation, supplier_document, again_ref, update_cost. However total, currency, warehouse, supplier_id and new_supplier are never explained, leaving roughly half of the 11 parameters to guesswork.

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?

A precise verb and resource ("Record a PURCHASE of goods from a supplier that already arrived") plus the exact downstream effect (purchase order, confirmation, goods receipt, stock grows). It explicitly separates itself from purchase_invoice_create_from_file and erp_product_create, so an agent can pick it out of a crowded sibling list without opening a schema.

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?

Gives concrete trigger phrases in the user's own languages («прийшла закупка від …», «купив у постачальника …», «внеси закупку») and states the exclusion for supplier PDFs/photos (route to purchase_invoice_create_from_file) and for missing catalog items (erp_product_create first). Duplicate delivery is redirected to again_ref. This is explicit when/when-not/alternative guidance.

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