Skip to main content
Glama

Taokeh MCP server

Stock movements

stock_movements
Read-only

Read the STOCK MOVEMENT LEDGER in bulk — every recorded change to on-hand quantity, across products, in one call. stock_level says how many you have RIGHT NOW for one product; this says WHAT MOVED, WHEN, WHY and WHAT IT LEFT BEHIND. Use it for stock-turn analysis, shrinkage hunting, reorder timing, or reconstructing how a balance got where it is. Every filter is optional and a bare call is a legitimate "what moved lately" pull: narrow with product (case-insensitive contains against the product name OR SKU), from/to (a window on each row's docDate) and sourceType (exactly one cause — see the list). Each row: ts (when it was posted), docDate (the document's own date, YYYY-MM-DD — a voided or edited bill's reversal keeps the bill's date, while a voided credit or debit note's reversal is dated the day of the void, like its journal entry; where no document survives, the Malaysian day it was posted), product {sku, name}, qtyDelta (signed — negative took stock out), balanceAfter (on-hand immediately after that move, as the posting path recorded it), unitCost, reason (free text the person typed, where there was one), sourceType and sourceId (the id of the document that moved it — pair it with search_documents to see which one). ⚠ WHICH MOVEMENTS EXIST AT ALL DEPENDS ON THIS COMPANY'S STOCK MODE, and the answer says which mode it is in (stockMode) with a note. In modified_periodic — the mode of companies created before 28 Sep 2026 unless they switched; newer companies start perpetual — selling does NOT move stock: invoices, delivery orders and credit notes write no movement row, and stock is trued up at stock take. Seeing no 'sale' rows there means the company is periodic; it does NOT mean nothing was sold, and it is NOT shrinkage. Only a perpetual company ORIGINATES sale / credit_note rows — but a periodic company can still HOLD them, and can still gain new ones: rows written while it ran perpetual stay, and a VOID takes its truth from the document's own movement rows rather than from today's setting, so voiding a perpetually-booked invoice or supplier return writes a fresh sale_void / debit_note_void row in a company that is periodic now. So a periodic company with movement rows is not a contradiction and not a bug. Read the mode before you interpret the rows, and read a row's own sourceType before you attribute it to the mode. balanceAfter is the total across the whole company, not per location; on a multi-location company each row also carries location. Rows come back newest first, capped at 200 with total, shown and more — when more is true, narrow by date and pull the periods in turn rather than treating a partial page as the whole. Values are verbatim as recorded at the time, never re-derived. ⛔ WHAT IT WILL NOT DO: it does not value your inventory (balance_sheet does), does not compute COGS or margin (income_statement, profit_drivers), and does not tell you what to reorder (low_stock). Nothing is written, and no draft is created.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoLatest docDate (YYYY-MM-DD; the document date, else the Malaysian posting day).
skuNoNOT a filter on this tool. Pass it as `product` — one case-insensitive contains matched against BOTH the product name and the SKU.
dateNoNOT 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.
fromNoEarliest docDate (YYYY-MM-DD; the document date, else the Malaysian posting day). The main way to break a >200-row pull into honest slices.
itemNoNOT a filter on this tool. Pass it as `product` — one case-insensitive contains matched against BOTH the product name and the SKU.
nameNoNOT a filter on this tool. Pass it as `product` — one case-insensitive contains matched against BOTH the product name and the SKU.
typeNoNOT a filter on this tool. Pass the movement cause as `sourceType`.
limitNoNOT 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.
queryNoNOT a filter on this tool. Pass it as `product` — one case-insensitive contains matched against BOTH the product name and the SKU.
dateToNoNOT a filter on this tool. Pass the end of the window as `to`.
reasonNoNOT 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').
sourceNoNOT a filter on this tool. Pass the movement cause as `sourceType`.
productNoCase-insensitive contains matched against the product NAME or SKU. Omit for every product.
dateFromNoNOT a filter on this tool. Pass the start of the window as `from`.
productIdNoNOT a filter on this tool. This search matches product TEXT, not ids — pass the name or SKU as `product`.
sourceTypeNoExactly 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).
productNameNoNOT a filter on this tool. Pass it as `product` — one case-insensitive contains matched against BOTH the product name and the SKU.

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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)."
  2. 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)."
  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 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."
  4. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only cover readOnlyHint and openWorldHint; the description carries a heavy load beyond that: the company stockMode caveat (periodic companies do not originate sale rows, absent sale rows are not shrinkage), which sourceTypes can exist per mode, that balanceAfter is company-wide and not per location, that rows are verbatim never re-derived, and the 200-row hard cap with total/shown/more pagination. It also confirms nothing is written and no draft is created.

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 single most decision-relevant distinction (ledger vs current level) and organised with signal markers (⚠, ⛔). It is long, and the docDate-reversal sub-clause is dense enough to slow a reader, but in a domain with this many mode-dependent edge cases most sentences earn their place.

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?

With no output schema, the description supplies the full row shape (ts, docDate, product, qtyDelta signed, balanceAfter, unitCost, reason, sourceType, sourceId, location) plus the pagination envelope. Given 17 parameters and the mode-dependent semantics, nothing an agent needs to call and correctly interpret this tool is 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 already 100%, so the baseline is 3, but the description adds real meaning: `product` is a case-insensitive contains against name OR SKU, `from`/`to` are a window on each row's docDate, and the docDate semantics (a voided bill's reversal keeps the bill date, a voided credit/debit note's reversal is dated the day of the void). It also reinforces that reason is returned not filtered and that limit is fixed. The sourceType enum list is repeated from the schema rather than extended.

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+resource (read the stock movement ledger in bulk) and immediately contrasts with the sibling stock_level ('how many you have RIGHT NOW for one product' vs 'WHAT MOVED, WHEN, WHY'). The scope is unambiguous and no sibling could be confused with it.

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?

Names concrete use cases (stock-turn analysis, shrinkage hunting, reorder timing, reconstructing a balance) and explicitly routes elsewhere for adjacent needs via the ⛔ block: valuation to balance_sheet, COGS/margin to income_statement and profit_drivers, reorder to low_stock. It also legitimises the bare no-filter call, so the agent knows when an unfiltered pull is acceptable.

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