Skip to main content
Glama

Update PrestaShop Stock

ps_update_stock
Idempotent

Updates the available quantity and out-of-stock behavior for a product or specific variant using its stock available ID.

Instructions

Update the available quantity for a product or a specific combination/variant.

⚠️ Requires PS_READONLY=false and PUT enabled on the PrestaShop Webservice key.

Args:

  • id: Stock available ID (use ps_get_product_stock to find it)

  • quantity: New quantity (must be >= 0)

  • out_of_stock: Behaviour when out of stock: 0=deny orders, 1=allow orders, 2=use shop default

Returns: Updated stock entry.

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": {
      "id": "<id>",
      "quantity": "<quantity>"
    },
    "name": "ps_update_stock"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesStock available ID (from ps_get_product_stock)
quantityYesNew quantity
out_of_stockNoOut-of-stock behaviour: 0=deny, 1=allow, 2=default
confirmation_tokenNoConfirmation token for destructive operations

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover safety (readOnlyHint=false, destructiveHint=false, idempotentHint=true), and the description adds genuinely new context: the write-permission prerequisites and the >=0 quantity constraint. It also states the return value, which matters given there is no output schema. The unexplained confirmation_token parameter is the notable omission.

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-loaded with the action and the warning, then a compact Args block. The Args list largely duplicates the JSON schema descriptions, which is mild redundancy, but every line is short and scannable.

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 a four-parameter mutation tool with no output schema, the definition covers prerequisites, required inputs, validation constraints, and the return shape. The only real gap is the confirmation_token, whose presence is never mentioned or explained despite being offered in the schema.

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 the baseline would be 3, but the description adds a cross-tool pointer for id and restates the quantity constraint in the Args block, which helps at decision time. The out_of_stock mapping is repeated verbatim from the schema rather than extended, and confirmation_token is never addressed.

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 ("Update the available quantity") and scopes it to "a product or a specific combination/variant", which separates it from the read-side sibling it names explicitly. An agent can tell this apart from ps_update_product or ps_get_product_stock without opening any schema.

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 a clear precondition (PS_READONLY=false and PUT enabled on the webservice key) and routes the agent to ps_get_product_stock to obtain the required id. It stops short of saying when not to use this tool (e.g., price or metadata changes belong to ps_update_product), so no explicit exclusions are present.

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