Skip to main content
Glama
Dolibarr MCP Server

Dolibarr MCP Server

Correct stock

dolibarr_stock_correct
Destructive

Records a manual stock correction in one warehouse: positive quantities add stock, negative quantities remove it. Preview mode shows changes first; confirm only after explicit approval.

Instructions

Books a manual stock correction in one warehouse: a positive qty adds stock, a negative qty removes it. For inventory corrections only; goods received, shipped, produced or consumed should go through receptions, shipments and manufacturing orders. This step cannot simply be undone: without confirm=true it only returns a preview.

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": {
      "product_id": "<product_id>",
      "qty": "<qty>",
      "label": "<label>",
      "warehouse_id": "<warehouse_id>"
    },
    "name": "dolibarr_stock_correct"
  }
}

Input Schema

NameRequiredDescriptionDefault
lotNoLot or serial number; required for lot-tracked products.
qtyYesPositive to add stock, negative to remove it (base unit).
eatbyNoBest-before date, only when this creates a new lot.
labelYesWhy: shown in the stock movement journal.
reasonNoOne line on why, kept in the audit log. Required when confirm is true.
sellbyNoSell-by date, only when this creates a new lot.
confirmNofalse (default) = change nothing, only show what would happen. true = do it. Set true only after the user has explicitly agreed to this exact step.
unit_costNoUnit cost of added stock, to update the weighted average cost.
product_idYes
warehouse_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and non-idempotent, and the description adds the crucial operational context: the change cannot simply be undone, and without confirm=true the call is a no-op preview. It also notes the reason field is kept in an audit log, which is behavior the agent cannot infer from 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?

Three compact sentences, front-loaded with purpose, then scope/exclusions, then the irreversibility and preview gate. No filler; every clause carries decision-relevant information.

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?

Covers the destructive semantics, the preview gate, and the audit-log requirement, which is the hard part for a 10-parameter mutation tool. Lot/serial and cost fields are left to a high-coverage schema, which is reasonable, though a note on whether repeated identical corrections are deduplicated would round it out.

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 80% and already documents qty sign, lot requirements, and confirm semantics in detail. The description reinforces the qty and confirm meaning in prose but adds no new parameter-level detail beyond the schema, so it sits at the baseline rather than above it.

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 specific verb and resource ("Books a manual stock correction") plus the sign convention that defines the operation (positive adds, negative removes) and its single-warehouse scope. It also names what this tool is not (receptions, shipments, manufacturing orders), so an agent can distinguish it from siblings without opening schemas.

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?

Explicitly gives when-to-use (inventory corrections) and when-not-to-use, routing goods received/shipped/produced/consumed to the appropriate alternative flows. It also states the precondition for committing (only after the user explicitly agrees to this exact step).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools