Skip to main content
Glama

Taokeh MCP server

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

update_invoice_draft

FILES A PENDING DRAFT ONLY — NOTHING CHANGES UNTIL A HUMAN REVIEWS AND APPROVES IT IN TAOKEH. Propose a correction to an invoice ALREADY POSTED in Taokeh — the door for an invoice that went onto the books with a wrong line, a wrong date or the wrong payment method. This does NOT change anything: it files a pending DRAFT an ADMIN reviews as a DIFF (current → proposed) and approves; only that tap rewrites the invoice, and it keeps the SAME invoice number, the original attached document and any payment-reminder history. Pass saleId, the invoice's REAL id from search_documents — an invoice number is refused, because two documents can carry the same printed number and correcting the wrong one is worse than asking. ROUTING — three different mistakes, three different doors, and picking the wrong one is expensive. (1) THE SALE NEVER HAPPENED (keyed twice, entered on the wrong company, cancelled before delivery): the owner VOIDS it — Sales → the invoice → Void, in Taokeh. There is deliberately NO AI lane for voiding; erasing a document from the books is a person's decision at the screen. Tell them where to click. (2) THE SALE HAPPENED BUT THE INVOICE IS WRONG (a wrong line, a wrong quantity or price, the wrong date, the wrong payment method): THIS tool. (3) SOMETHING CHANGED AFTER THE SALE (goods came back, a price was renegotiated, a discount was agreed later): create_credit_note_draft — a real event that belongs on the books as its own document, not an erasure of history. WHAT YOU CAN CHANGE: saleDate, paymentMethod ('CASH' or 'CREDIT'), refNo (the customer's own reference / PO number), term (the payment term, stored as written), dueDate (only when the due date ITSELF is wrong — correcting just the invoice date already moves the due date by the same number of days, so the agreed credit period survives), and lines — the FULL REPLACEMENT SET, so send every line the invoice should have, including the ones that were already right. ON A MEASUREMENT COMPANY, do NOT send the small negative rounding line the engine adds under a per-foot line: it is Taokeh's own line, not one of the invoice's, it is preserved untouched by a header-only correction, and it is re-derived from whatever timber line you do send. You cannot mark a line as one either — that is a fact Taokeh reads off the document, never something a caller asserts. WHAT YOU CANNOT, each refused by name: the CUSTOMER (a different customer is a different document — credit this one and raise a new invoice to the right party); the INVOICE NUMBER (preserved across an edit; Taokeh's own Edit screen cannot change it either); and the lines of an invoice that spreads its revenue over time under MFRS 15 (which new line inherits which schedule is a guess, and a guess about deferred revenue is not something a reviewer can check on a diff — header-only corrections still work and keep the schedule intact). SEVEN THINGS BLOCK AN EDIT OUTRIGHT, checked when you file and again when the admin taps, and each refusal names the real next step: the document is not an invoice; it is validated on MyInvois; it has been submitted to LHDN; a credit note or a debit note has been raised against it; it was consolidated from delivery orders; a payment has been allocated to it. A proposal that changes nothing is refused rather than filed as an empty diff for a human to tap. If the invoice is edited by someone else after you read it, the admin is shown BOTH versions and the one-tap approval is refused — that is by design; call revise_draft (kind 'invoice_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 anything they should double-check before they approve a rewrite of a posted document.
saleIdYesREQUIRED — the posted invoice's real id, from search_documents. An invoice number is refused: correcting the wrong document silently is worse than asking which one they mean.
proposedYesONLY what you want changed. An unknown or not-patchable key is refused by name; a proposal the invoice already agrees with is refused rather than filed.
needsReviewNoSet true when something gave you pause — a quantity you inferred, a price the user was unsure about. It flags the draft for the reviewer.
printedTotalNoThe grand total the corrected invoice should show, if the user told you one — cross-checked against the server's own derivation and flagged on the review screen. Reconcile a disagreement in chat; never quietly average the two.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed4 schema fields changed
    • changedInput schema / properties / proposed / properties / lines / description
      Previous value: -"The FULL replacement line set — every line the corrected invoice should have, not only the one that was wrong. Same shape as create_invoice_draft. Omit it entirely when you are only correcting header fields."New value: +"The FULL replacement line set — every line the corrected invoice should have, not only the one that was wrong. Same shape as create_invoice_draft. Omit it entirely when you are only correcting header fields. ⛔ LINE KEYS ARE STRICT, exactly as on create_invoice_draft: a key this schema does not list is REFUSED BY NAME and NOTHING is filed — the EDIT door and the CREATE door judge a line the same way (memory: erp-draft-lane-shared-rules)."
    • addedInput schema / properties / proposed / properties / lines / items / additionalProperties
      Added value: +false
    • addedInput schema / properties / proposed / properties / lines / items / properties / description / description
      Added value: +"The line text as PRINTED on the document, when it says more than the product name does — a size, a grade, a job reference, a period covered. It rides onto the posted line and prints on the customer's copy, so send what the paper says rather than a tidier phrasing of your own. Leave it out when the product name already says it. This is TEXT, not a field: Taokeh has no column for a dimension, a grade or a variant, so anything of that kind belongs here."
    • addedInput schema / properties / proposed / properties / lines / minItems
      Added value: +1
  2. Changed1 schema field changed
    • changedInput schema / properties / proposed / properties / lines / items / properties / quantity / description
      Previous value: -"The corrected line quantity. On a measurement-profile workspace OMIT it whenever you give thickness/width/tally, or write the measure detail into the description ('2x2 = 10/10 12/14') — the server derives the authoritative quantity, and a quantity sent alongside a parseable tally is kept as advisory only, never used to compute."New value: +"The corrected line quantity. On a measurement-profile company OMIT it whenever you give thickness/width/tally, or write the measure detail into the description ('2x2 = 10/10 12/14') — the server derives the authoritative quantity, and a quantity sent alongside a parseable tally is kept as advisory only, never used to compute."
  3. Changed1 schema field changed
    • addedInput schema / properties / proposed / properties / lines / items / properties / quantity / description
      Added value: +"The corrected line quantity. On a measurement-profile workspace OMIT it whenever you give thickness/width/tally, or write the measure detail into the description ('2x2 = 10/10 12/14') — the server derives the authoritative quantity, and a quantity sent alongside a parseable tally is kept as advisory only, never used to compute."
  4. Changed2 schema fields changed
    • addedInput schema / properties / proposed / properties / dueDate
      Added value: +{
      +  "anyOf": [
      +    {
      +      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "The due date as it should read, YYYY-MM-DD. Pass null to clear it, and the invoice date becomes the due date. Send this ONLY when the due date itself is what is wrong — if you are only correcting the INVOICE DATE, leave it out and Taokeh moves the due date by the same number of days, which keeps the agreed credit period intact (Net 30 stays 30 days)."
      +}
    • addedInput schema / properties / proposed / properties / term
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maxLength": 100,
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "The payment term as it should read ('Due on Receipt', 'Net 7', 'Net 14', 'Net 30', 'Net 60', or whatever this business actually agreed — it is stored as written, so do not round a real term to the nearest familiar one). Pass null to clear it. ON A POSTED INVOICE THE TERM IS A PRINTED LABEL AND NOTHING MORE: correcting it does NOT move the due date, because the document has already been out of the building and its due date is what the customer was told. If the due date is wrong too, propose `dueDate` explicitly alongside it."
      +}
  5. Added

TDQS

A4.9/5.0
Behavior5/5

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

The description discloses far more than annotations: no immediate mutation, human review as a diff, preservation of invoice number and attachments, double-checked blockers, refusal of no-op proposals, and concurrent-edit behavior. The readOnlyHint=false annotation is consistent with filing a pending draft; there is no contradiction.

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?

The description is long and dense, but the core constraint is front-loaded and headings like ROUTING, WHAT YOU CAN CHANGE, and WHAT YOU CANNOT make it scannable. It loses a point for restating some schema-level parameter guidance and for saying 'SEVEN THINGS' while enumerating only six blockers.

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?

Despite having no output schema, the description tells the agent everything needed to invoke correctly: effect, required identifier source, editable and non-editable fields, blocking conditions, and next-step routing. It is unusually complete for a high-complexity tool.

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?

Even with 100% schema coverage, the description adds significant parameter-level meaning: saleId must be the real document id rather than printed number, lines are a full replacement set with a measurement-company rounding-line caveat, term/dueDate interactions are explicit, and exclusions such as customer, invoice number, and MFRS15 lines are spelled out.

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?

The description opens with a precise statement: it files a pending correction draft for a posted invoice, and nothing changes until a human approves it in Taokeh. It clearly distinguishes itself from related siblings by naming the voiding path and create_credit_note_draft for post-sale changes.

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 explicitly maps three different mistake types to three different doors: manual void in Taokeh for sales that never happened, this tool for wrong posted invoices, and create_credit_note_draft for post-sale changes. It also lists concrete blockers, refusal cases, and directs the caller to revise_draft when a concurrent edit blocks approval.

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