Skip to main content
Glama

Taokeh MCP server

Replaced by its MCP Registry listing

This endpoint is listed in the official MCP Registry as mcp. If you published it, claim ownership there.

File debit-note draft

create_debit_note_draft

Files a pending sell-side debit-note draft: an additional charge on an invoice this business already issued (an undercharge, a price revised upward after delivery, a missed surcharge). It does not post; on approval in Taokeh it increases what the customer owes and the output SST. Field shapes: intake_contract(doc_type:'sales_debit_note'). The original invoice is required (originalDocId from search_documents, or originalDocNumber); there is no standalone shape, and a charge with no invoice behind it is a new invoice (create_invoice_draft). unitAmount is the amount added per unit (the shortfall, not the new price); quantity defaults to 1. Every line names a product that appears on that invoice. Money only: a debit note moves no stock and touches no COGS; extra goods delivered are a new invoice. There is no cap on the charge; the approver sees the original invoice's total beside it, and the result returns it as against.invoiceTotal. A one-tap approval is refused if the total changed since filing (for example an SST change). An invoice reversed from a Shopee, TikTok or Shopify Returns page is refused at filing and at approval. Scope: Taokeh's /debit-notes page is the buy side (purchase returns), with no AI lane for creating one; a posted buy-side note is corrected by update_supplier_debit_note_draft. A posted sell-side debit note has no correction lane: the owner voids it in Taokeh and a new one is filed. A filed draft is amended by revise_draft (kind 'sales_debit_note'). Line keys outside the schema are refused by name, with the likely intended key, and nothing is filed.

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": {
      "dnDate": "<dnDate>",
      "lines": "<lines>"
    },
    "name": "create_debit_note_draft"
  }
}

Input Schema

NameRequiredDescriptionDefault
linesYes
notesNoA short note for the reviewer (one or two sentences, shown at approval): what to double-check, such as which invoice it was matched to and where the figure came from.
dnDateYesThe debit-note date, YYYY-MM-DD in Malaysia time (MYT). A date before the invoice's date is refused, naming the invoice's date.
reasonNoWhy more is charged — 'price revised upward after delivery', 'surcharge missed'. It prints on the note.
customerNoOptional cross-check: the customer the invoice is believed to belong to. The customer comes from the invoice; a name that does not match is refused.
referenceNoThe debit-note number already printed on paper, if any. Leave it out and Taokeh numbers it (DN…).
customerIdNoThe resolved customer id, as the same cross-check.
needsReviewNo
printedTotalNoThe total printed on the paper, if any. Cross-check only — the server computes the real total and flags a mismatch on the approval screen.
originalDocIdNoThe original invoice's id, from search_documents (this or originalDocNumber is required). The server checks it exists, is an invoice, and whose it is.
originalDocNumberNoThe printed invoice number, when there is no id. Refused if more than one document carries it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed10 schema fields changed
    • changedInput schema / properties / customer / description
      Previous value: -"OPTIONAL CROSS-CHECK: the customer you believe the invoice belongs to. The customer comes FROM the invoice; sending a name that does not match is refused, which is exactly what it is for."New value: +"Optional cross-check: the customer the invoice is believed to belong to. The customer comes from the invoice; a name that does not match is refused."
    • changedInput schema / properties / dnDate / description
      Previous value: -"The debit-note date, YYYY-MM-DD in Malaysia time (MYT). Never before the date of the invoice it corrects: an earlier date is refused, naming the invoice's date."New value: +"The debit-note date, YYYY-MM-DD in Malaysia time (MYT). A date before the invoice's date is refused, naming the invoice's date."
    • changedInput schema / properties / lines / items / properties / description / description
      Previous value: -"What the extra charge is for, as it should print. Never copy a per-foot or per-piece line's printed note here (like \"(400' @ RM 1.60/ft)\"): it is refused. A money charge is quantity 1 at the amount with a plain description; more timber is a new invoice (create_invoice_draft)."New value: +"What the extra charge is for, as it should print. A line that copies a per-foot or per-piece line's printed note (like \"(400' @ RM 1.60/ft)\") is refused. A money charge is quantity 1 at the amount with a plain description; more timber is a new invoice (create_invoice_draft)."
    • changedInput schema / properties / lines / items / properties / productRef / description
      Previous value: -"The product id (resolve_product) or its exact name/SKU. It must be a product that ACTUALLY appears on that invoice — a debit note charges more for something the invoice already carried."New value: +"The product id (from resolve_product) or its exact name or SKU, of a product that appears on that invoice."
    • changedInput schema / properties / lines / items / properties / quantity / description
      Previous value: -"Defaults to 1 — an additional charge is usually one line of money, not a quantity. Send it only when the shortfall is genuinely per-unit across several units."New value: +"Defaults to 1, since an additional charge is usually one line of money. More than 1 only when the shortfall is per unit across several units."
    • changedInput schema / properties / lines / items / properties / taxCode / description
      Previous value: -"Leave it OUT and the server inherits the ORIGINAL invoice's own code for this product, so the charge carries exactly the SST the invoice charged. Only set it when the paper says otherwise."New value: +"Optional. Left out, the line inherits the original invoice's own code for this product, so the charge carries the SST the invoice charged."
    • changedInput schema / properties / lines / items / properties / unitAmount / description
      Previous value: -"The ADDITIONAL ringgit per unit — the shortfall being charged, NOT the corrected full price. Filing the full price charges the whole line a second time. 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."New value: +"The additional ringgit per unit: the shortfall being charged, not the corrected full price (the full price would charge the whole line again). Two decimals at most (whole sen, or whole cents in another currency). Discount and tax have their own fields and are not folded into the price."
    • changedInput schema / properties / notes / description
      Previous value: -"A SHORT reviewer note: one or two plain sentences, in the reviewer's language, naming what the human should double-check before approving — which invoice you matched it to, where the figure came from. Not lengthy reasoning."New value: +"A short note for the reviewer (one or two sentences, shown at approval): what to double-check, such as which invoice it was matched to and where the figure came from."
    • changedInput schema / properties / originalDocId / description
      Previous value: -"REQUIRED (this or originalDocNumber): the ORIGINAL invoice's id, from search_documents. The server verifies it exists, is an INVOICE and whose it is — it never guesses, and it will not file a debit note without one."New value: +"The original invoice's id, from search_documents (this or originalDocNumber is required). The server checks it exists, is an invoice, and whose it is."
    • changedInput schema / properties / originalDocNumber / description
      Previous value: -"The printed invoice number, when you have no id. Refused if more than one document carries it — find the right one with search_documents."New value: +"The printed invoice number, when there is no id. Refused if more than one document carries it."
  3. Changed1 schema field changed
    • changedInput schema / properties / lines / items / properties / description / description
      Previous value: -"What the extra charge is for, as it should print. Never copy a per-foot or per-piece line's printed note here (like \"(400' @ RM 1.60/feet)\"): it is refused. A money charge is quantity 1 at the amount with a plain description; more timber is a new invoice (create_invoice_draft)."New value: +"What the extra charge is for, as it should print. Never copy a per-foot or per-piece line's printed note here (like \"(400' @ RM 1.60/ft)\"): it is refused. A money charge is quantity 1 at the amount with a plain description; more timber is a new invoice (create_invoice_draft)."
  4. Changed1 schema field changed
    • addedInput schema / properties / dnDate / description
      Added value: +"The debit-note date, YYYY-MM-DD in Malaysia time (MYT). Never before the date of the invoice it corrects: an earlier date is refused, naming the invoice's date."
  5. Changed1 schema field changed
    • changedInput schema / properties / lines / items / properties / description / description
      Previous value: -"What the extra charge is for, as it should print."New value: +"What the extra charge is for, as it should print. Never copy a per-foot or per-piece line's printed note here (like \"(400' @ RM 1.60/feet)\"): it is refused. A money charge is quantity 1 at the amount with a plain description; more timber is a new invoice (create_invoice_draft)."
  6. Changed1 schema field changed
    • changedInput schema / properties / lines / items / properties / unitAmount / description
      Previous value: -"The ADDITIONAL ringgit per unit — the shortfall being charged, NOT the corrected full price. Filing the full price charges the whole line a second time."New value: +"The ADDITIONAL ringgit per unit — the shortfall being charged, NOT the corrected full price. Filing the full price charges the whole line a second time. 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."
  7. Changed1 schema field changed
    • addedInput schema / properties / lines / items / additionalProperties
      Added value: +false
  8. Added

TDQS

A4.8/5.0
Behavior5/5

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

Well beyond the annotations, the description discloses the draft lifecycle ("It does not post; on approval in Taokeh it increases what the customer owes and the output SST"), approval-time revalidation against a changed total, the refusal path for Shopee/TikTok/Shopify-returns-reversed invoices, the absence of a charge cap, and that the result surfaces against.invoiceTotal. It even specifies the failure mode for out-of-schema line keys (refused by name with the likely intended key, nothing filed).

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?

It is front-loaded with purpose, then constraints, then scope, so an agent reading only the first two sentences can still select and call it. The prose is dense but nearly every clause carries a rule that changes behavior; the one soft spot is a few constraint sentences that run long enough to blur together.

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 an 11-parameter, non-idempotent creation tool with no output schema, the description covers the missing pieces: what the call returns (against.invoiceTotal), what approval does to the ledger and SST, what gets refused at filing versus approval, and which sibling handles each adjacent case. Nothing an agent needs to call it correctly appears to be absent.

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 82%, so the baseline is 3; the description adds real meaning on top by insisting the original invoice is required, telling the agent where originalDocId comes from (search_documents) versus originalDocNumber, and pinning the units of unitAmount (the shortfall per unit, not the corrected price) and quantity's default of 1. Some of this restates the schema's own text, which keeps it from a 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?

The opening sentence names a specific verb and resource — "Files a pending sell-side debit-note draft" — and immediately defines the resource as "an additional charge on an invoice this business already issued," with concrete examples (undercharge, price revised upward, missed surcharge). It also draws the contrast with the nearest ambiguity, stating a charge with no invoice behind it is create_invoice_draft, which an agent can act on without opening either 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?

It routes the agent explicitly among alternatives: no underlying invoice goes to create_invoice_draft, amendments go to revise_draft (kind 'sales_debit_note'), buy-side corrections go to update_supplier_debit_note_draft, and a posted sell-side note must be voided in Taokeh because no correction lane exists. It also states exclusions — reversed marketplace invoices are refused, and goods (not money) are a new invoice.

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