Skip to main content
Glama

Adjust stock

adjust_stock
Destructive

Move a product stock by a relative delta (negative to write off, positive to add) with a reason, and record it in the stock history. This is the correct tool for a correction, a write-off or damage — it never sets an absolute number, so an order committing at the same moment is not overwritten. The reason decides the direction: write_off, damage and return_to_supplier must carry a negative delta, opening_balance a positive one, while correction and other accept either; a delta that contradicts its reason is rejected. Any other word is your own vocabulary and is accepted in either direction. The product must already track inventory; a product that does not returns a conflict rather than having tracking switched on for it. A bundle also returns a conflict: its stock is derived from its components, so adjust each component instead. Pass a stable externalId to make a retry idempotent. The new stock is pushed to every connected sales channel. The result echoes the operating workspace.

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": {
      "delta": "<delta>",
      "productId": "<productId>",
      "reason": "<reason>"
    },
    "name": "adjust_stock"
  }
}

Input Schema

NameRequiredDescriptionDefault
noteNo
deltaYes
reasonYes
metadataNo
productIdYes
externalIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, but the description adds substantial context: stock history is recorded, reason/delta contradictions are rejected, non-tracked products and bundles return conflicts, externalId makes retries idempotent, and new stock is pushed to connected sales channels. These are meaningful behavioral traits beyond 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but front-loaded and well structured: it starts with the core operation, then covers usage, reason constraints, conflict cases, idempotency, and side effects. Every sentence carries operational value, and the ordering follows what an agent needs to decide whether and how to call the tool.

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?

Given a six-parameter mutation tool with no output schema and annotations that only cover safety hints, the description is nearly complete: it covers behavior, validation, conflicts, idempotency, and side effects. The main gaps are the unexplained optional parameters (note, metadata) and only a minimal statement about the return value.

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 description coverage is 0%, so the description must carry the burden. It adds important semantics for delta (relative, negative/positive), reason (direction rules and vocabulary), and externalId (idempotency), but it does not explain note or metadata at all, leaving two of six parameters undocumented.

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 states a specific verb and resource ('Move a product stock by a relative delta') and immediately distinguishes the operation from an absolute stock set. It also names the precise scenarios it serves (correction, write-off, damage) and contrasts its behavior with an order commit that might otherwise overwrite stock.

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 explicitly says this is the correct tool for correction, write-off, or damage, and that it never sets an absolute number. It also gives clear when-not guidance for bundles ('adjust each component instead') and explains how reason constrains the allowed delta direction.

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