Skip to main content
Glama

Taokeh MCP server

File a pending correction draft for a posted supplier debit note (human approves in Taokeh)

update_supplier_debit_note_draft

FILES A PENDING DRAFT ONLY — NOTHING CHANGES UNTIL A HUMAN REVIEWS AND APPROVES IT IN TAOKEH. Propose a correction to a BUY-SIDE DEBIT NOTE already posted in Taokeh — a purchase return raised against a SUPPLIER's bill (Taokeh's /debit-notes page). This is NOT the sell-side debit note that create_debit_note_draft files (an additional charge on your own invoice); that document has no correction lane at all — the owner voids it and issues a new one. An ADMIN reviews this as a DIFF (current → proposed) and approves; only that tap re-books the note, and it keeps the SAME debit-note number, the bill it was raised against and any attached document. Pass debitNoteId, the note's REAL id from search_documents (docType debit_note). ROUTING — (1) THE RETURN NEVER HAPPENED (keyed twice, wrong bill): the owner VOIDS the note in Taokeh (Debit notes → the note → Void); voiding keeps it on the register marked VOID. A note VALIDATED on MyInvois cannot be voided: any further correction goes through LHDN against the validated document. (2) THE RETURN IS RIGHT BUT TYPED WRONG (a wrong line, quantity, cost, date or reason): THIS tool. (3) MORE GOODS WENT BACK LATER: a new debit note, raised by the owner in Taokeh — there is no AI lane for creating a buy-side debit note. WHAT YOU CAN CHANGE: dnDate, reason, and lines — the FULL REPLACEMENT SET. ⛔ EVERY LINE MUST ANSWER goodsReturned (true = these goods physically went back to the supplier and leave stock, false = money only). There is no default. Your answer only PRE-FILLS the admin's per-line question on the full review page; a ONE-TAP approval never moves stock and is refused whenever the note already took goods off the shelf or any line says goods went back. Stock only ever leaves for a product the BILL actually received, never more than the bill still has standing (a goods line that sends back more is refused with both quantities named, when you file and when the admin taps; a money-only line is not capped by quantity), and never more than is on hand (see STOCK below). SST is inherited from the bill — there is no tax code to send. A NOTE WITH A DISCOUNTED LINE (search_document_lines shows discount on it): its lines cannot be corrected here at all — any lines proposal on it is refused, and the owner changes them in Taokeh (Debit notes → Edit); a date or reason correction (no lines) still works and reposts the note's own lines, discounts included. WHAT YOU CANNOT, each refused by name: the SUPPLIER, the debit-note NUMBER, the BILL it was raised against. BLOCKED OUTRIGHT, checked when you file (the server runs the real correction and rolls it back) and again when the admin taps: the note is voided; it is validated or exported for MyInvois as a self-billed document; a supplier refund is allocated to it, or its credit was used on a payment to the supplier; the bill it was raised against is gone; its date is inside a LOCKED period; or the corrected note would credit more than the bill still owes — UNLESS the note already carries the supplier's own credit note number (it then may credit up to the bill's value less its other debit notes, and the extra is money the supplier owes back). This tool cannot add that number: the owner enters it on the note's Edit form in Taokeh (Supplier’s credit note no.); say so instead of filing a correction that goes over. A proposal that changes nothing is refused. If the note is edited after you read it, the one-tap approval is refused — call revise_draft (kind 'supplier_debit_note_update'). ⛔ STOCK (stock-modes S1; sweep 18a): on a tracked (perpetual) company a correction that returns more than is on hand is refused at approve. On a not-tracked (periodic) company it is refused when you file and again when the admin taps, naming each short item with what it sends back and what is on hand. The way out, in this order: if the goods really went back, put the extra on a money-only line (goodsReturned false) so the note keeps its value; if fewer went back, reduce the line to what really went back. The note's own earlier take counts as on hand, so an ordinary note's unchanged quantity passes; a note posted before 2 Nov 2026 that took fewer units than its lines say is refused even unchanged.

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": {
      "debitNoteId": "<debitNoteId>",
      "proposed": "<proposed>"
    },
    "name": "update_supplier_debit_note_draft"
  }
}

Input Schema

NameRequiredDescriptionDefault
notesNoA SHORT reviewer note: what was wrong, what you changed, and whether the goods really went back.
proposedYesONLY what you want changed. An unknown or not-patchable key is refused by name.
debitNoteIdYesREQUIRED — the posted BUY-side debit note's real id, from search_documents (docType debit_note).
needsReviewNoSet true when something gave you pause.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / proposed / properties / lines / description
      Previous value: -"The FULL replacement line set. Omit it entirely when you are only correcting the date or the reason. A line carrying a converted per-foot or per-piece cost's printed note (like \"(400' @ RM 1.60/feet)\") is refused unless the bill has that very line with no discount: its rounding sits in the bill line's discount, which this tool cannot send, so that change is made on Taokeh's Edit screen (Debit notes → Edit)."New value: +"The FULL replacement line set. Omit it entirely when you are only correcting the date or the reason. A line carrying a converted per-foot or per-piece cost's printed note (like \"(400' @ RM 1.60/ft)\") is refused unless the bill has that very line with no discount: its rounding sits in the bill line's discount, which this tool cannot send, so that change is made on Taokeh's Edit screen (Debit notes → Edit)."
  2. Changed1 schema field changed
    • changedInput schema / properties / proposed / properties / dnDate / description
      Previous value: -"The corrected debit-note date, YYYY-MM-DD in Malaysia time (MYT)."New value: +"The corrected debit-note date, YYYY-MM-DD in Malaysia time (MYT). Never before the date of the bill the note is against: an earlier date is refused when you file, naming the bill's date."
  3. Changed1 schema field changed
    • changedInput schema / properties / proposed / properties / lines / description
      Previous value: -"The FULL replacement line set. Omit it entirely when you are only correcting the date or the reason."New value: +"The FULL replacement line set. Omit it entirely when you are only correcting the date or the reason. A line carrying a converted per-foot or per-piece cost's printed note (like \"(400' @ RM 1.60/feet)\") is refused unless the bill has that very line with no discount: its rounding sits in the bill line's discount, which this tool cannot send, so that change is made on Taokeh's Edit screen (Debit notes → Edit)."
  4. Changed1 schema field changed
    • changedInput schema / properties / proposed / properties / lines / items / properties / unitCost / description
      Previous value: -"Ringgit per unit (the bill’s cost), POSITIVE. Two decimals at most (whole sen, or whole cents in another currency), exactly as invoiced; put a discount or tax in its own field, never folded into the cost."New value: +"Ringgit per unit (the bill’s cost), POSITIVE. Up to four decimals (e.g. 0.0325), exactly as invoiced — but a per-foot or per-piece price that Taokeh converts to tons: two decimals. Put a discount or tax in its own field, never folded into the cost."
  5. Changed1 schema field changed
    • changedInput schema / properties / proposed / properties / lines / items / properties / unitCost / description
      Previous value: -"Ringgit per unit (the bill’s cost), POSITIVE."New value: +"Ringgit per unit (the bill’s cost), POSITIVE. Two decimals at most (whole sen, or whole cents in another currency), exactly as invoiced; put a discount or tax in its own field, never folded into the cost."
  6. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare the safety profile (readOnly=false, destructive=false, idempotent=false), and the description goes far beyond them: nothing changes until a human approves, the admin sees a diff, the note keeps its number/bill/attachments, and the post-approval behaviour of stock is spelled out. It also discloses the unusual validation model — the server runs the real correction and rolls it back at file time, then re-checks on approval — plus the full list of named refusal conditions (voided, MyInvois validated, allocated refund, locked period, bill deleted, over-credit) and the optimistic-concurrency failure mode.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loading is excellent — the 'FILES A PENDING DRAFT ONLY' constraint and the three-way routing come first — and the block headings (ROUTING, WHAT YOU CAN CHANGE, WHAT YOU CANNOT, BLOCKED, STOCK) give it scannable structure. But the body is a very long wall of conditionals with deep parenthetical nesting and repeated re-statements of stock and refusal rules, which raises the risk an agent skims past a load-bearing clause such as the goodsReturned-per-line requirement.

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 mutation tool with nested line objects, no output schema and unusual stock/approval semantics, the definition covers every decision an agent must make: which ids to pass and where to get them, what is patchable, what is refused by name, when to escalate to the owner's Edit form, and the ordered fallback when stock is short. Nothing material is left to inference, including the SST-is-inherited and cannot-add-supplier-credit-note-number limits.

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 3 is the floor, and the description genuinely adds meaning on top: 'dnDate, reason, and lines — the FULL REPLACEMENT SET' tells the agent lines replaces rather than patches, and the schema's own note that lines may be omitted for date-only/reason-only corrections is reinforced. The goodsReturned mandate and the discounted-line refusal are also stated behaviourally, not just as field docs. It stops short of 5 only because most per-field meaning is already carried by the unusually rich schema descriptions.

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 — 'Propose a correction to a BUY-SIDE DEBIT NOTE already posted in Taokeh' — and explicitly disambiguates from the sell-side sibling create_debit_note_draft, which 'has no correction lane at all'. It also anchors the document to a concrete location (Taokeh's /debit-notes page) and to the purchase-return meaning, so an agent can tell it apart from every other draft tool 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?

The ROUTING block gives three mutually exclusive situations with the exact tool or action for each: void in Taokeh when the return never happened, THIS tool when the return is right but typed wrong, and a new owner-raised note when more goods went back. It further names revise_draft (kind 'supplier_debit_note_update') as the alternative when the note was edited after reading, which is the kind of exclusion most definitions omit.

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