Skip to main content
Glama

Taokeh MCP server

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

update_credit_note_draft

FILES A PENDING DRAFT ONLY — NOTHING CHANGES UNTIL A HUMAN REVIEWS AND APPROVES IT IN TAOKEH. Propose a correction to a SALES CREDIT NOTE already posted in Taokeh — the door for a credit note that went onto the books with a wrong line, quantity, price, date or reason. An ADMIN reviews it as a DIFF (current → proposed) and approves; only that tap re-books the note, and it keeps the SAME credit-note number, the invoice it credits and any attached document. Pass creditNoteId, the note's REAL id from search_documents (docType credit_note) — a credit-note number is refused. ROUTING — three different mistakes, three different doors. (1) THE CREDIT NEVER SHOULD HAVE EXISTED (keyed twice, wrong customer, raised against the wrong invoice): the owner VOIDS it — Credit notes → the note → Void, in Taokeh; voiding keeps the note on the register marked VOID, and there is deliberately no AI lane for it. A note VALIDATED on MyInvois cannot be voided: any further correction goes through LHDN against the validated document. (2) THE CREDIT IS RIGHT BUT TYPED WRONG: THIS tool. (3) SOMETHING NEW HAPPENED LATER (more goods came back, a further allowance was agreed): a NEW credit note with create_credit_note_draft — a later event is its own document, not a rewrite of this one. WHAT YOU CAN CHANGE: cnDate, reason, and lines — the FULL REPLACEMENT SET (send every line the note should have, including the ones that were already right). ⛔ EVERY LINE MUST ANSWER goodsReturned (true = these goods physically came back into stock, false = money only). There is no default. Your answer only PRE-FILLS the admin's per-line question on the full review page — the admin's answer is what posts — and a ONE-TAP approval never moves stock: it is refused whenever the note already put goods back or any line says goods came back, so those corrections are approved on the review page. Leave taxCode out and the line inherits the note's own SST code for that product; a NEW product on a taxed note has nothing to inherit and is refused by name. A NOTE ON A WHOLE-DOCUMENT SST RATE (the note, or the invoice it credits, has no SST codes at all, and that rate is not 0) is refused unless EVERY line you send carries a taxCode — the app's own Edit applies the same rule, so the two never post different tax. 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 (Credit notes → Edit), where the Discount box is; a date or reason correction (no lines) still works and reposts the note's own lines, discounts included. A NOTE THAT CARRIES THE INVOICE'S ROUNDING OR ADJUSTMENT LINE (a line with a NEGATIVE unit price — the web form brings it along on a whole return): the same — any lines proposal is refused, because a line you send cannot carry it, and the owner changes the lines in Taokeh (Credit notes → the note → Edit); a date or reason correction still works and reposts that line as it is. WHAT YOU CANNOT, each refused by name: the CUSTOMER, the credit-note NUMBER, and the INVOICE it credits. THINGS THAT BLOCK AN EDIT OUTRIGHT, checked when you file (the server runs the real correction and rolls it back, so every refusal approval would give you is given NOW) and again when the admin taps: the note is voided; it is validated on MyInvois (it cannot be voided either: any further correction goes through LHDN against the validated document); exported for MyInvois, or submitted to LHDN (the owner voids it instead — the void clears the export and says what to do at MyInvois); a customer refund is allocated to it; the invoice it credits is gone or is not an invoice; its date is inside a LOCKED period; it put goods back under the company's previous stock setting; or the corrected note would credit more than the invoice has left, or put back more than the invoice shipped. A proposal that changes nothing is refused rather than filed. If the note is edited by someone else after you read it, the one-tap approval is refused — call revise_draft (kind 'credit_note_update') to re-read and re-propose.

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": {
      "creditNoteId": "<creditNoteId>",
      "proposed": "<proposed>"
    },
    "name": "update_credit_note_draft"
  }
}

Input Schema

NameRequiredDescriptionDefault
notesNoA SHORT reviewer note in the reviewer's language: what was wrong, what you changed, and — above all — whether the goods really came back.
proposedYesONLY what you want changed. An unknown or not-patchable key is refused by name.
needsReviewNoSet true when something gave you pause.
creditNoteIdYesREQUIRED — the posted credit note's real id, from search_documents (docType credit_note). A credit-note number is refused.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / proposed / properties / cnDate / description
      Previous value: -"The corrected credit-note date, YYYY-MM-DD in Malaysia time (MYT)."New value: +"The corrected credit-note date, YYYY-MM-DD in Malaysia time (MYT). Never before the date of the invoice it credits: an earlier date is refused, naming that date."
  2. Changed1 schema field changed
    • changedInput schema / properties / proposed / properties / lines / items / properties / unitPrice / description
      Previous value: -"POSITIVE ringgit per unit."New value: +"POSITIVE ringgit per unit. Two decimals at most (whole sen, or whole cents in another currency); put a discount or tax in its own field, never folded into the price."
  3. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false; the description adds the crucial behavioral fact that nothing posts until a human approves a diff, that one-tap approval never moves stock, and a full enumerated list of refusal conditions checked both at filing and at approval. No contradiction with the non-destructive annotation — filing a pending draft is a write but not a destructive one.

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?

The key constraint is front-loaded, but the body is a dense all-caps wall with duplication — the MyInvois validated/void rule appears both in the routing section and again in the blockers list, and the discounted-line and negative-price cases restate the same 'lines refused, date/reason still works' pattern. Much of it earns its place given the complexity, but the repetition and shouting reduce scannability.

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 nested-object mutation with no output schema, the description is unusually complete: it covers permitted fields, per-line requirements, refusal conditions, stock effects, and the approval lifecycle. The only gap is that it never says what a successful call returns (draft id, status, review link), which an agent calling with no output schema would benefit from.

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 100%, so the baseline would be 3, but the description adds real semantics: creditNoteId must be the real id from search_documents (a note number is refused), lines is a FULL replacement set, goodsReturned has no default and only pre-fills the admin's answer, and taxCode omission inherits the note's SST code. These are rules the schema alone cannot convey.

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 precise verb, resource and scope: 'FILES A PENDING DRAFT ONLY' for 'a correction to a SALES CREDIT NOTE already posted'. It explicitly distinguishes itself from create_credit_note_draft (new document) and from the void path, so an agent can route 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 Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit three-way routing rule: void in Taokeh when the credit never should have existed, THIS tool when the credit is right but typed wrong, and create_credit_note_draft when a later event occurred. It also names revise_draft for the concurrent-edit case, so both when-to-use and when-not-to-use are covered.

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