Skip to main content
Glama

Taokeh MCP server

Replaced by its MCP Registry listing

This endpoint is listed in the official MCP Registry as mcp. If you published it, claim ownership there.

Stock movements

stock_movements
Read-only

The stock movement ledger in bulk: every recorded change to on-hand quantity, across products, newest first. stock_level gives one product's quantity now; this gives what moved, when, why and the balance it left. A revaluation row has qtyDelta 0 and carries the new average cost in unitCost. Every filter is optional: product, from/to (on docDate) and sourceType. Each row: ts (posted), docDate (the document's date; a voided or edited bill's reversal keeps the bill's date, a voided credit or debit note's reversal takes the void date; with no document, the Malaysian posting day), product {sku, name}, qtyDelta (negative took stock out), balanceAfter (company-wide on-hand after the move), unitCost, reason, sourceType, sourceId (the document's id, as search_documents returns it), location on a multi-location company, and editReversal:true on a purchase_void or sale_void row written by an edit, not a void (when the edit kept the product, its repost is the purchase or sale row at the same ts). stockMode says how the company records stock. Under modified_periodic (companies created before 28 Sep 2026 unless switched) selling writes no movement row and stock is trued up at stock take, so missing sale rows are not missing sales or shrinkage; rows written while a company ran perpetual remain, and voiding a perpetually-booked document still writes its reversal row. A stock take at one location can write a pair of stock_take rows under one sourceId with opposite qtyDelta (one at the location, one at no location): the pair nets to zero and moves stock between shelves, not in or out. Capped at 200 rows with total, shown and more. Values are as recorded. It does not value inventory (balance_sheet), compute COGS or margin (income_statement, profit_drivers) or suggest reorders (low_stock).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "stock_movements"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoLatest docDate, `YYYY-MM-DD` (the document date, else the Malaysian posting day).
skuNoNot a filter on this tool. Product text goes in `product`: one case-insensitive contains matched against both the product name and the SKU.
dateNoNot a filter on this tool. The date window is `from` and/or `to` (`YYYY-MM-DD`); one day is `from` and `to` set to the same date.
fromNoEarliest docDate, `YYYY-MM-DD` (the document date, else the Malaysian posting day). A narrower window splits a pull of more than 200 rows.
itemNoNot a filter on this tool. Product text goes in `product`: one case-insensitive contains matched against both the product name and the SKU.
nameNoNot a filter on this tool. Product text goes in `product`: one case-insensitive contains matched against both the product name and the SKU.
typeNoNot a filter on this tool. The movement cause is `sourceType`.
limitNoNot a filter on this tool. The page size is fixed at 200 movements; `from`/`to`, `product` and `sourceType` narrow the pull.
queryNoNot a filter on this tool. Product text goes in `product`: one case-insensitive contains matched against both the product name and the SKU.
dateToNoNot a filter on this tool. The end of the window is `to`.
reasonNoNot a filter on this tool. `reason` is the free text typed for a movement and comes back on each row; the cause filter is `sourceType` (e.g. `adjustment`).
sourceNoNot a filter on this tool. The movement cause is `sourceType`.
productNoCase-insensitive contains, matched against the product name or SKU. Omitted: every product.
dateFromNoNot a filter on this tool. The start of the window is `from`.
productIdNoNot a filter on this tool. This search matches product text, not ids; the name or SKU goes in `product`.
sourceTypeNoOne movement cause: purchase, purchase_void, debit_note, debit_note_void, adjustment, stock_take, import_opening, assembly_out, assembly_in, disassembly_out, disassembly_in, sale, sale_void, credit_note, transfer_out, transfer_in, revaluation. Only perpetual stock creates sale, sale_void, credit_note rows; a company that switched to periodic keeps the ones it wrote.
productNameNoNot a filter on this tool. Product text goes in `product`: one case-insensitive contains matched against both the product name and the SKU.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed17 schema fields changed
    • changedInput schema / properties / date / description
      Previous value: -"NOT a filter on this tool. Pass a date WINDOW as `from` and/or `to` (YYYY-MM-DD). A single date is `from` and `to` set to the same day."New value: +"Not a filter on this tool. The date window is `from` and/or `to` (`YYYY-MM-DD`); one day is `from` and `to` set to the same date."
    • changedInput schema / properties / dateFrom / description
      Previous value: -"NOT a filter on this tool. Pass the start of the window as `from`."New value: +"Not a filter on this tool. The start of the window is `from`."
    • changedInput schema / properties / dateTo / description
      Previous value: -"NOT a filter on this tool. Pass the end of the window as `to`."New value: +"Not a filter on this tool. The end of the window is `to`."
    • changedInput schema / properties / from / description
      Previous value: -"Earliest docDate (YYYY-MM-DD; the document date, else the Malaysian posting day). The main way to break a >200-row pull into honest slices."New value: +"Earliest docDate, `YYYY-MM-DD` (the document date, else the Malaysian posting day). A narrower window splits a pull of more than 200 rows."
    • changedInput schema / properties / item / description
      Previous value: -"NOT a filter on this tool. Pass it as `product` — one case-insensitive contains matched against BOTH the product name and the SKU."New value: +"Not a filter on this tool. Product text goes in `product`: one case-insensitive contains matched against both the product name and the SKU."
    • changedInput schema / properties / limit / description
      Previous value: -"NOT a filter on this tool. The page size is fixed at 200 movements. Narrow with from/to, product or sourceType and pull the periods in turn."New value: +"Not a filter on this tool. The page size is fixed at 200 movements; `from`/`to`, `product` and `sourceType` narrow the pull."
    • changedInput schema / properties / name / description
      Previous value: -"NOT a filter on this tool. Pass it as `product` — one case-insensitive contains matched against BOTH the product name and the SKU."New value: +"Not a filter on this tool. Product text goes in `product`: one case-insensitive contains matched against both the product name and the SKU."
    • changedInput schema / properties / product / description
      Previous value: -"Case-insensitive contains matched against the product NAME or SKU. Omit for every product."New value: +"Case-insensitive contains, matched against the product name or SKU. Omitted: every product."
    • changedInput schema / properties / productId / description
      Previous value: -"NOT a filter on this tool. This search matches product TEXT, not ids — pass the name or SKU as `product`."New value: +"Not a filter on this tool. This search matches product text, not ids; the name or SKU goes in `product`."
    • changedInput schema / properties / productName / description
      Previous value: -"NOT a filter on this tool. Pass it as `product` — one case-insensitive contains matched against BOTH the product name and the SKU."New value: +"Not a filter on this tool. Product text goes in `product`: one case-insensitive contains matched against both the product name and the SKU."
    • changedInput schema / properties / query / description
      Previous value: -"NOT a filter on this tool. Pass it as `product` — one case-insensitive contains matched against BOTH the product name and the SKU."New value: +"Not a filter on this tool. Product text goes in `product`: one case-insensitive contains matched against both the product name and the SKU."
    • changedInput schema / properties / reason / description
      Previous value: -"NOT a filter on this tool. `reason` is free text the person typed and is RETURNED on each row, not a filter. To narrow by cause use `sourceType` (e.g. 'adjustment')."New value: +"Not a filter on this tool. `reason` is the free text typed for a movement and comes back on each row; the cause filter is `sourceType` (e.g. `adjustment`)."
    • changedInput schema / properties / sku / description
      Previous value: -"NOT a filter on this tool. Pass it as `product` — one case-insensitive contains matched against BOTH the product name and the SKU."New value: +"Not a filter on this tool. Product text goes in `product`: one case-insensitive contains matched against both the product name and the SKU."
    • changedInput schema / properties / source / description
      Previous value: -"NOT a filter on this tool. Pass the movement cause as `sourceType`."New value: +"Not a filter on this tool. The movement cause is `sourceType`."
    • changedInput schema / properties / sourceType / description
      Previous value: -"Exactly one movement cause. One of: purchase, purchase_void, debit_note, debit_note_void, adjustment, stock_take, import_opening, assembly_out, assembly_in, disassembly_out, disassembly_in, sale, sale_void, credit_note, transfer_out, transfer_in, revaluation. Note that sale, sale_void, credit_note are only ever CREATED by a perpetual company — a company that has since switched to periodic still holds the ones it wrote (and a void of one of those documents still writes its reversal leg)."New value: +"One movement cause: purchase, purchase_void, debit_note, debit_note_void, adjustment, stock_take, import_opening, assembly_out, assembly_in, disassembly_out, disassembly_in, sale, sale_void, credit_note, transfer_out, transfer_in, revaluation. Only perpetual stock creates sale, sale_void, credit_note rows; a company that switched to periodic keeps the ones it wrote."
    • changedInput schema / properties / to / description
      Previous value: -"Latest docDate (YYYY-MM-DD; the document date, else the Malaysian posting day)."New value: +"Latest docDate, `YYYY-MM-DD` (the document date, else the Malaysian posting day)."
    • changedInput schema / properties / type / description
      Previous value: -"NOT a filter on this tool. Pass the movement cause as `sourceType`."New value: +"Not a filter on this tool. The movement cause is `sourceType`."
  3. Changed1 schema field changed
    • changedInput schema / properties / sourceType / description
      Previous value: -"Exactly one movement cause. One of: purchase, purchase_void, debit_note, debit_note_void, adjustment, stock_take, import_opening, assembly_out, assembly_in, disassembly_out, disassembly_in, sale, sale_void, credit_note, transfer_out, transfer_in. Note that sale, sale_void, credit_note are only ever CREATED by a perpetual company — a company that has since switched to periodic still holds the ones it wrote (and a void of one of those documents still writes its reversal leg)."New value: +"Exactly one movement cause. One of: purchase, purchase_void, debit_note, debit_note_void, adjustment, stock_take, import_opening, assembly_out, assembly_in, disassembly_out, disassembly_in, sale, sale_void, credit_note, transfer_out, transfer_in, revaluation. Note that sale, sale_void, credit_note are only ever CREATED by a perpetual company — a company that has since switched to periodic still holds the ones it wrote (and a void of one of those documents still writes its reversal leg)."
  4. Changed2 schema fields changed
    • changedInput schema / properties / from / description
      Previous value: -"Earliest movement date (YYYY-MM-DD, Malaysian time). The main way to break a >200-row pull into honest slices."New value: +"Earliest docDate (YYYY-MM-DD; the document date, else the Malaysian posting day). The main way to break a >200-row pull into honest slices."
    • changedInput schema / properties / to / description
      Previous value: -"Latest movement date (YYYY-MM-DD, Malaysian time)."New value: +"Latest docDate (YYYY-MM-DD; the document date, else the Malaysian posting day)."
  5. Changed1 schema field changed
    • changedInput schema / properties / sourceType / description
      Previous value: -"Exactly one movement cause. One of: purchase, purchase_void, debit_note, debit_note_void, adjustment, stock_take, import_opening, assembly_out, assembly_in, disassembly_out, disassembly_in, sale, sale_void, credit_note, transfer_out, transfer_in. Note that sale, sale_void, credit_note only ever exist in a perpetual company."New value: +"Exactly one movement cause. One of: purchase, purchase_void, debit_note, debit_note_void, adjustment, stock_take, import_opening, assembly_out, assembly_in, disassembly_out, disassembly_in, sale, sale_void, credit_note, transfer_out, transfer_in. Note that sale, sale_void, credit_note are only ever CREATED by a perpetual company — a company that has since switched to periodic still holds the ones it wrote (and a void of one of those documents still writes its reversal leg)."
  6. Changed1 schema field changed
    • changedInput schema / properties / sourceType / description
      Previous value: -"Exactly one movement cause. One of: purchase, purchase_void, debit_note, debit_note_void, adjustment, stock_take, import_opening, assembly_out, assembly_in, disassembly_out, disassembly_in, sale, sale_void, credit_note, transfer_out, transfer_in. Note that sale, sale_void, credit_note only ever exist in a perpetual workspace."New value: +"Exactly one movement cause. One of: purchase, purchase_void, debit_note, debit_note_void, adjustment, stock_take, import_opening, assembly_out, assembly_in, disassembly_out, disassembly_in, sale, sale_void, credit_note, transfer_out, transfer_in. Note that sale, sale_void, credit_note only ever exist in a perpetual company."
  7. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations cover safety (readOnly, non-destructive, closed world), yet the description adds substantial behavior beyond them: the 200-row cap with total/shown/more, the modified_periodic stockMode caveat explaining why sale rows may be absent, the stock_take pair that nets to zero, editReversal rows, and docDate semantics for voided documents. The only gap is that return ordering beyond 'newest first' and any latency/rate behavior are unstated.

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?

It is long, but the length is front-loaded with the core purpose and each block (row shape, stockMode, stock-take pairs, cap, exclusions) carries distinct decision-relevant information. A few sentences duplicate what the input schema already documents (filter list, product matching) and could be trimmed.

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 a 17-parameter, no-required-filter ledger tool with no output schema, the description supplies the row shape field-by-field, the periodic-versus-perpetual interpretation rule, reversal semantics, and pagination behavior. Nothing an agent needs to query and read results correctly appears to be missing.

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 is 3; the description earns above that by clarifying that filters are optional, that from/to apply to docDate, that a narrower window splits a >200-row pull, and by explaining what a revaluation row (qtyDelta 0, cost in unitCost) means. It doesn't add much beyond the schema for product matching or sourceType values, which the schema already enumerates.

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?

Opens with a specific verb and resource ('The stock movement ledger in bulk: every recorded change to on-hand quantity, across products, newest first') and explicitly contrasts with stock_level ('gives one product's quantity now; this gives what moved, when, why and the balance it left'). An agent can distinguish this from stock_level and the reporting siblings 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?

States when to use it versus stock_level, and closes with explicit exclusions routing to balance_sheet, income_statement, profit_drivers and low_stock. It also says all filters are optional, which tells the agent it can call with no arguments.

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