Skip to main content
Glama

Upsert Bills of Materials

upsert_bills_of_materials
DestructiveIdempotent

Create or replace bills of materials by finished-good SKU (max 500 per call) — the manufacturing seeding path. Each row is one finished good plus its COMPLETE component list (component SKU + quantity per unit, optional UoM/note/scrap); an existing BOM's components are replaced by the list, so resubmitting is safe (the upsert converges). The finished good and every component must already exist as items in the credential's namespace — nothing is auto-created; use upsert_items first (labor/overhead lines are items too, typically type=noninventory). Created BOMs are flagged primary so planning explodes them. Set validateOnly=true first to get every row's would_create/would_replace/invalid verdict without writing, then re-call without it to apply. Partial success: valid rows land even when siblings fail, with per-row errors naming the unresolved SKUs. A row reported partially_applied was written but didn't finish cleanly — re-send it to converge. Operator (unpinned) credentials on 3PL tenants pass clientId to resolve SKUs within that client's namespace.

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": {
      "boms": "<boms>"
    },
    "name": "upsert_bills_of_materials"
  }
}

Input Schema

NameRequiredDescriptionDefault
bomsYesBOM rows (max 500). finishedGoodSku and a non-empty components list are required per row.
clientIdNoOptional client id (GUID) for operator (unpinned) credentials on 3PL tenants: resolves finished-good/component SKUs within that client's namespace — get ids from list_clients. Client-pinned credentials omit this; the credential decides.
validateOnlyNotrue = dry-run: validate + probe every row and report would_create/would_replace per row, writing nothing. Recommended before the first real call.

Output Schema

NameRequiredDescriptionDefault
rowsNo
totalNo
failedNo
createdNo
replacedNo
validateOnlyNo
partiallyAppliedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already flag destructiveHint and idempotentHint, and the description substantiates both: existing components are replaced by the submitted list and resubmitting converges. It goes further with partial-success semantics, per-row errors naming unresolved SKUs, and the partially_applied state that must be re-sent — behavior an agent cannot get from the annotations.

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 verb, resource, and the most consequential rule (components are replaced) before secondary prerequisites. It is a dense single paragraph with some stacking of edge cases (partial success, partially_applied, operator credentials), but nearly every clause carries operational value.

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 bulk upsert this covers prerequisites, dry-run workflow, failure modes, and credential scoping. An output schema exists, so return shape need not be explained, yet the description still tells the agent what verdicts to expect from validateOnly. Nothing needed 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.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents boms, clientId, and validateOnly in detail. The description reinforces the important ones (dry-run recommended before first call, clientId only for unpinned operator credentials, 500-row cap) but adds little syntax or semantics the schema does not already carry, so the baseline of 3 applies.

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 and resource ("Create or replace bills of materials by finished-good SKU") with scope limits (max 500) and semantic detail (each row is a finished good plus its COMPLETE component list). The "manufacturing seeding path" framing helps an agent orient. It does not, however, contrast itself with the sibling set_bill_of_materials or list_bills_of_materials, so sibling differentiation is only partial.

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 concrete sequencing guidance: items must exist first and "use upsert_items first," run with validateOnly=true to get verdicts, then re-call to apply, and pass clientId for operator credentials on 3PL tenants. Missing only explicit when-not guidance, e.g. when to choose set_bill_of_materials instead of this upsert.

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