Skip to main content
Glama

Upsert Item Sourcing Profile

upsert_item_sourcing_profile
DestructiveIdempotent

Create or update an item's sourcing profile (its default price book + production spec). Matching: with name, the item's profile of that name is updated (or created); without name, the item's single existing profile is updated — ambiguous or first-time cases require name. The item's owner is derived server-side; a book attributed to a different client is refused; the spec is validated against the book's schema (invalid specs are refused, never priced). Set preview=true for the governed two-step protocol (a validated would-be profile plus a single-use previewReceipt); repeat with that receipt and a fresh idempotencyKey to commit.

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": {
      "itemSku": "<itemSku>",
      "bookId": "<bookId>",
      "spec": "<spec>"
    },
    "name": "upsert_item_sourcing_profile"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoEdition label (e.g. "Hardback"). Optional when updating an item's only profile; required to create.
specYesCost-driver attribute values keyed by the book's schema, e.g. {"trim": "6x9"}.
bookIdYesThe default price book id (GUID) for this edition.
itemSkuYesThe item SKU this profile belongs to.
previewNoStep 1 of the required two-step write: set true to validate and receive the would-be profile plus a single-use previewReceipt. Nothing is written until the commit call.
isDefaultNoMake this the item's default profile. Omitted = preserve current state.
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
createdNo
previewNo
profileNo
expiresAtNo
actionItemIdNo
confirmationNo
correlationIdNo
approvalResultNo
idempotencyKeyNo
previewReceiptNo
idempotentReplayNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations (destructive/idempotent hints) by disclosing server-side owner derivation, refusal of books attributed to another client, schema validation of the spec with no pricing of invalid specs, and the two-step preview/receipt commit protocol. These are exactly the failure modes an agent needs before calling a destructive upsert.

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 purpose, then matching rules, then refusal behaviors, then the protocol — a sensible order. The semicolon-chained middle sentence about owner derivation and validation is dense but every clause carries information; nothing is filler.

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 8-parameter destructive upsert with a nested spec object, the definition covers matching, authorization, validation, and commit flow, while an output schema and full parameter descriptions handle return values and field defaults. Slightly more detail on how `isDefault` interacts with matching would make it complete.

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 baseline is 3, but the description adds real semantics: the conditional role of `name`, and the coupled use of `preview`, `previewReceipt`, and a fresh `idempotencyKey` across two calls. Minor tension with the schema wording ("required two-step write" vs "Set preview=true"), but the operational meaning is clear.

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?

States a concrete verb and resource ("Create or update an item's sourcing profile") and immediately scopes what a profile is ("its default price book + production spec"). This clearly separates it from the read-only sibling list_item_sourcing_profiles.

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 selection rules: with name the profile of that name is upserted, without name only the item's single existing profile is updated, and ambiguous or first-time cases require name. It also routes to the preview/commit protocol. It does not explicitly name sibling tools, but the when-to-use conditions are unambiguous.

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