Skip to main content
Glama

Set Bill of Materials

set_bill_of_materials
DestructiveIdempotent

Create or replace ONE finished good's bill of materials (finished good by item id or SKU) with the complete component list given: lines not in the list are removed. Components resolve by SKU in the finished good's client namespace and must already exist (labor/overhead lines are noninventory items); nothing is auto-created. The preview shows the BOM before and after with added, removed and changed lines. Preview first, then repeat identical arguments with previewReceipt and a fresh idempotencyKey. Requires Write + manufacturing.execute and the Manufacturing plan. To seed many BOMs at once use upsert_bills_of_materials. In-app assistants get a confirm card the user applies.

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": {
      "finishedGood": "<finishedGood>",
      "components": "<components>"
    },
    "name": "set_bill_of_materials"
  }
}

Input Schema

NameRequiredDescriptionDefault
noteNoOptional BOM note. Omit to keep the current note; an empty string clears it.
previewNoStep 1 of the required two-step write: set true to validate and receive a structured preview plus a single-use previewReceipt. Nothing changes until the commit call.
componentsYesThe complete component list (1–500 lines): component SKU and quantity per unit, optional uom, scrapPercentage, isOptional, note, isPhantom, subAssemblyBomId.
finishedGoodYesThe finished good's item id (GUID) or SKU.
idempotencyKeyNoCaller-generated idempotency key; required with previewReceipt to commit.
previewReceiptNoStep 2 of the required two-step write: the receipt returned by the preview call. Supply together with a fresh idempotencyKey to commit; calls without it are refused.

Output Schema

NameRequiredDescriptionDefault
okNo
bomIdNo
actionNo
appliedNo
previewNo
expiresAtNo
componentsNo
actionItemIdNo
confirmationNo
correlationIdNo
approvalResultNo
idempotencyKeyNo
previewReceiptNo
idempotentReplayNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

The annotations already mark this as destructive and idempotent, and the description adds substantial behavioral detail: lines not in the list are removed, components must already exist and are never auto-created, the preview shows before/after added/removed/changed lines, and in-app assistants get a confirm card. It also discloses required permissions and the Manufacturing plan.

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?

The description is dense but front-loaded: the core 'create or replace' scope and removal behavior come first, followed by component resolution, preview flow, permissions, and the bulk alternative. Every sentence contributes practical information.

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?

Given the destructive write operation, the two-step preview/commit flow, the available output schema, and the 100% schema coverage, the description is complete enough for an agent to call it correctly. It covers scope, side effects, prerequisites, and the bulk alternative.

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 description coverage is 100%, so the baseline is 3, but the description adds meaning beyond the schema by explaining that component SKUs resolve in the finished good's client namespace and must already exist. It also clarifies the previewReceipt plus fresh idempotencyKey commit pattern beyond what the individual parameter descriptions state.

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: 'Create or replace ONE finished good's bill of materials' and immediately scopes it to 'the complete component list given: lines not in the list are removed.' It explicitly distinguishes itself from the bulk sibling by saying to use upsert_bills_of_materials to seed many BOMs at once.

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 when-to-use guidance for the single-BOM case and names the alternative for many BOMs. It also specifies the required preview-then-commit sequence, the need to repeat identical arguments with previewReceipt and a fresh idempotencyKey, and the permission and plan prerequisites.

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