Skip to main content
Glama
PNPC-MCP-Tally-Prime

PNPC-MCP-Tally-Prime

update_voucher

DestructiveIdempotent

Modify an existing TallyPrime voucher by matching its type, date, and number, then replace its ledger entries, narration, and related details while preserving correct voucher identity.

Instructions

Update an existing voucher in TallyPrime, replacing its ledger entries and narration. The voucher is matched by type + date + voucher number, so that combination must be unique and must exactly match an existing voucher (use get_ledger_vouchers or get_vouchers first to confirm it). Either pass debitLedger/creditLedger/amount for a simple 2-leg voucher, or pass 'entries' for 3+ lines, same as create_voucher. Refuses if another voucher type shares the same number on that date (confirmed live: Tally's Alter lookup ignores voucher type and can silently corrupt the wrong one) — resolve the collision in Tally first if that happens.

Input Schema

NameRequiredDescriptionDefault
dateYesExisting voucher's date in DD-MM-YYYY format
modeNoTally's voucher entry mode (the 'Change Voucher Mode' choice in the voucher screen). 'Accounting Invoice' posts it as an invoice with plain ledger lines, the way invoice-mode Tax Invoices are entered — partyLedger is then required. 'As Voucher' posts the normal Dr/Cr voucher view and records that mode. Omit to post the normal voucher view without stamping a mode (right for Payment, Receipt, Contra). For Item Invoice (stock lines) use create_sales_invoice and its siblings instead.
amountNoNew amount of the transaction (simple 2-leg mode; omit if using 'entries')
entriesNoFor a voucher with more than 2 lines: an array of { ledgerName, amount, type: 'debit'|'credit', billName?, billType?, costCentre?, costCategory?, description? }, same shape as create_voucher's entries. Debit and credit amounts must sum to the same total. When provided, this replaces debitLedger/creditLedger/amount.
buyerTrnNoThe buyer's TRN on this voucher — same voucher-level field and Sales-class caveat as create_voucher's buyerTrn.
buyerNameNoName to print in this voucher's Buyer (Bill to) box, when it should differ from the customer ledger's own name — Tally's per-voucher Party Details mailing name. The ledger itself is not changed. Useful when many sales are posted against one shared ledger (e.g. cash or card sales) but each invoice needs its own readable buyer name.
narrationNoNew narration / description for the voucher
referenceNoFree-text reference for this voucher, backed by Tally's voucher-level REFERENCE field — same field and same independence from voucherNumber/bill references as on create_voucher.
buyerStateNoThe buyer's Emirate/state on this voucher's Party Details.
debitLedgerNoLedger name to debit (simple 2-leg mode; omit if using 'entries')
partyLedgerNoThe customer or supplier ledger the invoice is raised on — required with mode 'Accounting Invoice', and must be one of this voucher's own ledger lines (it's placed first and marked as the party, as Tally does).
voucherTypeYesVoucher type, e.g. 'Payment', 'Receipt', 'Journal'
buyerCountryNoThe buyer's country on this voucher's Party Details.
costCategoryNoCost category the cost centre belongs to. Defaults to 'Primary Cost Category'.
creditLedgerNoLedger name to credit (simple 2-leg mode; omit if using 'entries')
referenceDateNoDate for the reference above, in DD-MM-YYYY format (Tally's REFERENCEDATE field). Independent of the voucher's own date.
voucherNumberYesExact voucher number of the voucher to update
debitCostCentreNoCost centre to allocate the debit leg to (optional).
creditCostCentreNoCost centre to allocate the credit leg to (optional).
debitDescriptionNoAdditional description lines for the debit leg (Tally's 'Additional Descriptions for Ledgers'), one array entry per line. This update replaces the voucher's ledger lines, so pass the existing descriptions again if they should be kept — omitting them here removes them.
creditDescriptionNoSame as debitDescription, for the credit leg.
placeOfSupplyCountryNoUAE VAT Place of Supply Country for this voucher.
placeOfSupplyEmirateNoUAE VAT Place of Supply Emirate for this voucher.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.14.1
    • addedInput schema / properties / buyerName
      Added value: +{
      +  "description": "Name to print in this voucher's Buyer (Bill to) box, when it should differ from the customer ledger's own name — Tally's per-voucher Party Details mailing name. The ledger itself is not changed. Useful when many sales are posted against one shared ledger (e.g. cash or card sales) but each invoice needs its own readable buyer name.",
      +  "type": "string"
      +}
  2. Changed2 schema fields changedv1.14.0
    • addedInput schema / properties / mode
      Added value: +{
      +  "description": "Tally's voucher entry mode (the 'Change Voucher Mode' choice in the voucher screen). 'Accounting Invoice' posts it as an invoice with plain ledger lines, the way invoice-mode Tax Invoices are entered — partyLedger is then required. 'As Voucher' posts the normal Dr/Cr voucher view and records that mode. Omit to post the normal voucher view without stamping a mode (right for Payment, Receipt, Contra). For Item Invoice (stock lines) use create_sales_invoice and its siblings instead.",
      +  "enum": [
      +    "As Voucher",
      +    "Accounting Invoice"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / partyLedger
      Added value: +{
      +  "description": "The customer or supplier ledger the invoice is raised on — required with mode 'Accounting Invoice', and must be one of this voucher's own ledger lines (it's placed first and marked as the party, as Tally does).",
      +  "type": "string"
      +}
  3. Changed4 schema fields changedv1.13.1
    • addedInput schema / properties / creditDescription
      Added value: +{
      +  "description": "Same as debitDescription, for the credit leg.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / debitDescription
      Added value: +{
      +  "description": "Additional description lines for the debit leg (Tally's 'Additional Descriptions for Ledgers'), one array entry per line. This update replaces the voucher's ledger lines, so pass the existing descriptions again if they should be kept — omitting them here removes them.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / entries / description
      Previous value: -"For a voucher with more than 2 lines: an array of { ledgerName, amount, type: 'debit'|'credit', billName?, billType?, costCentre?, costCategory? }, same shape as create_voucher's entries. Debit and credit amounts must sum to the same total. When provided, this replaces debitLedger/creditLedger/amount."New value: +"For a voucher with more than 2 lines: an array of { ledgerName, amount, type: 'debit'|'credit', billName?, billType?, costCentre?, costCategory?, description? }, same shape as create_voucher's entries. Debit and credit amounts must sum to the same total. When provided, this replaces debitLedger/creditLedger/amount."
    • addedInput schema / properties / entries / items / properties / description
      Added value: +{
      +  "description": "Additional description lines for this ledger line, one array entry per line.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  4. Changed12 schema fields changedv1.11.2
    • changedInput schema / properties / amount / description
      Previous value: -"New amount of the transaction"New value: +"New amount of the transaction (simple 2-leg mode; omit if using 'entries')"
    • addedInput schema / properties / buyerCountry
      Added value: +{
      +  "description": "The buyer's country on this voucher's Party Details.",
      +  "type": "string"
      +}
    • addedInput schema / properties / buyerState
      Added value: +{
      +  "description": "The buyer's Emirate/state on this voucher's Party Details.",
      +  "type": "string"
      +}
    • addedInput schema / properties / buyerTrn
      Added value: +{
      +  "description": "The buyer's TRN on this voucher — same voucher-level field and Sales-class caveat as create_voucher's buyerTrn.",
      +  "type": "string"
      +}
    • changedInput schema / properties / creditLedger / description
      Previous value: -"Ledger name to credit"New value: +"Ledger name to credit (simple 2-leg mode; omit if using 'entries')"
    • changedInput schema / properties / debitLedger / description
      Previous value: -"Ledger name to debit"New value: +"Ledger name to debit (simple 2-leg mode; omit if using 'entries')"
    • addedInput schema / properties / entries
      Added value: +{
      +  "description": "For a voucher with more than 2 lines: an array of { ledgerName, amount, type: 'debit'|'credit', billName?, billType?, costCentre?, costCategory? }, same shape as create_voucher's entries. Debit and credit amounts must sum to the same total. When provided, this replaces debitLedger/creditLedger/amount.",
      +  "items": {
      +    "properties": {
      +      "amount": {
      +        "type": "number"
      +      },
      +      "billName": {
      +        "type": "string"
      +      },
      +      "billType": {
      +        "type": "string"
      +      },
      +      "costCategory": {
      +        "type": "string"
      +      },
      +      "costCentre": {
      +        "type": "string"
      +      },
      +      "ledgerName": {
      +        "type": "string"
      +      },
      +      "type": {
      +        "enum": [
      +          "debit",
      +          "credit"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "ledgerName",
      +      "amount",
      +      "type"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / placeOfSupplyCountry
      Added value: +{
      +  "description": "UAE VAT Place of Supply Country for this voucher.",
      +  "type": "string"
      +}
    • addedInput schema / properties / placeOfSupplyEmirate
      Added value: +{
      +  "description": "UAE VAT Place of Supply Emirate for this voucher.",
      +  "type": "string"
      +}
    • addedInput schema / properties / reference
      Added value: +{
      +  "description": "Free-text reference for this voucher, backed by Tally's voucher-level REFERENCE field — same field and same independence from voucherNumber/bill references as on create_voucher.",
      +  "type": "string"
      +}
    • addedInput schema / properties / referenceDate
      Added value: +{
      +  "description": "Date for the reference above, in DD-MM-YYYY format (Tally's REFERENCEDATE field). Independent of the voucher's own date.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "voucherType",
      -  "voucherNumber",
      -  "date",
      -  "debitLedger",
      -  "creditLedger",
      -  "amount"
      -]New value: +[
      +  "voucherType",
      +  "voucherNumber",
      +  "date"
      +]
  5. First observedv1.0.3

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already flag this as destructive and mutating, but the description adds real detail beyond them: the update REPLACES ledger entries and narration, the match key must be unique, and the tool deliberately refuses when another voucher type shares the number on that date, with the reason given (Tally's Alter lookup ignores voucher type and can corrupt the wrong record). It stops short of describing the return payload or what happens to unspecified fields such as reference/buyerTrn.

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?

Front-loaded with the operation and match key, then prerequisites, then the branch rule, then the failure mode. Dense and largely waste-free, though the long parenthetical about Tally's Alter lookup could be tightened without losing meaning.

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 23-parameter destructive mutation with no output schema, the description covers identity matching, the two entry modes, the item-invoice alternative, and the collision refusal. Remaining gap: it does not say what the response looks like or clarify whether omitted optional fields (reference, buyerTrn, party details) are cleared, even though it does warn about that for description lines.

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, but the description adds genuinely useful semantics on top: which three parameters form the identity key, that those values must exactly match an existing voucher, and that the 2-leg fields and 'entries' are mutually exclusive pathways mirroring create_voucher.

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 ('Update an existing voucher in TallyPrime') plus the exact identity key used to locate the record (type + date + voucher number). It clearly distinguishes itself from create_voucher (same entry shapes, different operation) and points item-invoice work at create_sales_invoice.

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 prerequisite sequence ('use get_ledger_vouchers or get_vouchers first to confirm it'), an explicit exclusion ('For Item Invoice (stock lines) use create_sales_invoice and its siblings instead'), and an explicit branch rule (2-leg fields vs 'entries' for 3+ lines). It also states the failure condition under which the call is refused.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools