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. (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, 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.

Input Schema

TableJSON 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 / 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."
  2. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only say write/non-destructive/non-idempotent; the description adds the crucial behavior that nothing posts until an admin approves a diff, that the note keeps its number/invoice/attachments, and the full list of conditions that block an edit (validated/exported note, refund allocated, locked period, over-credit). It even discloses that the server dry-runs the correction and rolls it back so refusals surface at filing time.

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?

It is front-loaded with the key constraint ('FILES A PENDING DRAFT ONLY') and the complexity genuinely warrants detail, but the wall of all-caps text re-states schema content verbatim (goodsReturned 'no default', taxCode inheritance) and repeats the goodsReturned rule twice, so not every sentence earns its 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 and a nested-object payload, the description carries the full burden and does: it covers the approval flow, the three changeable fields, per-scenario refusals (discounted line, negative-unit-price adjustment line, whole-document SST rate), and the concurrency path. An agent has everything needed to call it correctly.

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, and the description does add meaning: creditNoteId must be the real id from search_documents (a number is refused), lines is a full replacement set, and taxCode omission triggers inheritance with a named refusal when there is nothing to inherit. Much of the goodsReturned/taxCode text duplicates the schema, keeping it just short of 5.

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 SALES CREDIT NOTE already posted in Taokeh'. It explicitly separates itself from create_credit_note_draft (a later event is its own document) and from voiding in Taokeh, so an agent can pick the right tool without reading 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?

The ROUTING section gives an explicit three-way decision rule (credit never should have existed → void; credit is right but typed wrong → this tool; something new happened later → create_credit_note_draft). It also enumerates what is refused outright and the concurrency escape hatch to revise_draft, leaving essentially nothing to inference.

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