Skip to main content
Glama

Mango Inventory

Create item

create_item

Create an inventory item. Requires the manager role. A category is required unless isDraft is true: a call without categoryId returns { missingCategory, categories } and writes nothing. The server checks that the category exists, not that it fits the item. Required fields per category come from get_item_requirements; when some are missing the call returns { missingFields } and creates nothing, and the same call with those values in customFields (keys = fieldDefId) creates the item. isDraft: true saves an incomplete draft without the required-field and category checks, which the user finishes in the app. At the organization's item allowance the call returns { itemLimitReached } and creates nothing; drafts do not count against the allowance and can still be saved at it. For quantity-tracked stock (consumables like paper or markers) pass trackingMode "quantity" with quantity and an optional minStock. With clientRequestId a repeated call returns the existing item instead of a duplicate; without it every call creates a new item. preview_item_create renders the same proposal as an editable confirm card in widget hosts; its button calls this tool.

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": {
      "name": "<name>"
    },
    "name": "create_item"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesItem name (required)
isDraftNoSave as an incomplete draft (skips the required-fields check; the user finishes it in the app)
minStockNoOptional restock threshold for quantity-tracked stock
quantityNoInitial stock amount — required with trackingMode "quantity"
categoryIdNoCategory id (from get_item_requirements); required unless isDraft is true
descriptionNo
customFieldsNoField values keyed by fieldDefId (from get_item_requirements). Dates as a plain calendar day "YYYY-MM-DD" (a full timestamp works too, but only WITH an explicit offset — this server has no timezone and does no conversion), selects as one of the listed options, multiselect as an ARRAY of option strings, currency as a plain number in the field's own currency (see its currencyCode; default CHF), url as a full http(s) link (protocol added when missing).
trackingModeNo"quantity" for quantity-tracked stock (consumables) instead of a serialized single item
homeLocationIdNoHome location resource id (from search_resources); absent = the category or organization default
clientRequestIdNoA unique id for this creation (e.g. a UUID). A repeated call with the SAME id returns the existing item instead of creating a duplicate; a new id creates a new item.
responsiblePersonIdNoResponsible person resource id (optional)

Output Schema

NameRequiredDescriptionDefault
idNoItem id
nameNoItem name
usageNoTracked items the organization has, with itemLimitReached
statusNoCondition: available | in_repair | defect | lost | retired ("available" means not defect/lost/retired — the item may still be borrowed)
webUrlNoLink to this item in the web app, for a person to open. Absent when the deployment has no public address configured
isDraftNoPresent and true only for an unfinished draft capture
modelIdNoThe item's model — pass it as create_order lines[].modelId to order any instance of this model
categoryNoCategory name
quantityNoHow many this row stands for — only on quantity-tracked pools. To count a pool, SUM this; to count serialized items, count rows
allowanceNoItems the organization's package includes, with itemLimitReached
containerNoThe container this item is packed into, if any
modelNameNoThe model's name
categoriesNoThe organization's category tree, sent with a missingCategory round so the retry costs one call. Empty means the org has no categories yet
compartmentNoThe compartment of that container the item sits in (absent = directly in the container)
descriptionNoItem description
instructionNoExplanation of a round that wrote nothing (missing fields, missing category, allowance reached)
primaryCodeNoThe code printed on the item's asset tag — how a human tells two identical models apart. Absent when no code is attached
homeLocationNoWhere the item belongs
trackingModeNo"quantity" for a stock pool counted by amount. Absent = a serialized item, i.e. this row IS one physical thing
contentsCountNoDirect contents count — containers only
currentHolderNoPerson currently holding it
missingFieldsNoPresent INSTEAD of the item when required values are missing: nothing was created; the same call with these values in customFields creates it
currentLocationNoWhere the item is now
effectiveHolderNoHolder followed through the container chain
missingCategoryNoPresent and true when the call carried no categoryId — nothing was created; every item except a draft needs a category
itemLimitReachedNoPresent and true when the organization is at its included item allowance — nothing was created and no retry of this call will succeed
effectiveLocationNoLocation followed through the container chain
responsiblePersonNoPerson responsible
missingFieldLabelsNoLabels a saved DRAFT still needs before it can be published — the user finishes them in the app

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • changedInput schema / properties / categoryId / description
      Previous value: -"Category id (resolve with get_item_requirements) — required unless isDraft is true"New value: +"Category id (from get_item_requirements); required unless isDraft is true"
    • changedInput schema / properties / clientRequestId / description
      Previous value: -"Recommended: a unique id you generate for this creation (e.g. a UUID). Retrying with the SAME id returns the existing item instead of creating a duplicate. Use a fresh id for each new item."New value: +"A unique id for this creation (e.g. a UUID). A repeated call with the SAME id returns the existing item instead of creating a duplicate; a new id creates a new item."
    • changedInput schema / properties / homeLocationId / description
      Previous value: -"Home location resource id (find with search_resources); omit to use the org/category default"New value: +"Home location resource id (from search_resources); absent = the category or organization default"
    • changedInput schema / properties / trackingMode / description
      Previous value: -"Pass \"quantity\" for quantity-tracked stock (consumables) instead of a serialized single item"New value: +"\"quantity\" for quantity-tracked stock (consumables) instead of a serialized single item"
    • changedOutput schema / properties / instruction / description
      Previous value: -"What to do next — present on every round that wrote nothing (missing fields, missing category, allowance reached)"New value: +"Explanation of a round that wrote nothing (missing fields, missing category, allowance reached)"
    • changedOutput schema / properties / missingFields / description
      Previous value: -"Present INSTEAD of the item when required values are missing — nothing was created; ask your user and retry with them in customFields"New value: +"Present INSTEAD of the item when required values are missing: nothing was created; the same call with these values in customFields creates it"
    • changedOutput schema / properties / webUrl / description
      Previous value: -"Link to this item in the web app — give it to your user so they can look at the record themselves. Absent when the deployment has no public address configured"New value: +"Link to this item in the web app, for a person to open. Absent when the deployment has no public address configured"
  2. First observed

TDQS

A5/5.0
Behavior5/5

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

Far beyond the boolean annotations, it discloses the manager-role prerequisite, the exact refusal payloads ({ missingCategory, categories }, { missingFields }, { itemLimitReached }) and that each refusal writes nothing, the org item-allowance ceiling with the draft exemption, and the clientRequestId idempotency contract. These are precisely the mutation risks an agent cannot infer from readOnlyHint/destructiveHint alone.

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?

Dense but front-loaded: intent first, then gating rules, then failure contracts, then sibling routing. Every sentence carries a decision-relevant constraint, with no restatement of the schema's field list or filler.

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?

For an 11-parameter mutation with nested customFields, a single-value enum, and an output schema, the description covers everything the schema and annotations cannot: permissions, conditional requiredness, failure shapes, limits, and idempotency. Nothing an agent needs in order to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 91%, so the baseline is 3, but the description adds real meaning: the categoryId/isDraft dependency, the customFields keyed-by-fieldDefId retry pattern after a missingFields response, and the coupling of trackingMode "quantity" with quantity and minStock. That is semantics the schema does not encode.

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?

"Create an inventory item" is a specific verb+resource statement, and the description goes further by scoping the behavior (draft vs. full creation, quantity vs. serialized) and by naming preview_item_create as the widget-host path that calls this tool. The agent can distinguish this from siblings like assign_item or update_item without opening a schema.

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 branch conditions: categoryId required unless isDraft is true, trackingMode "quantity" for consumables, clientRequestId for de-duplication, and preview_item_create when a confirm card UI is wanted. It also points at get_item_requirements as the source of required fields and implies the category-membership check is not performed here (only existence), steering the agent appropriately.

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