Skip to main content
Glama
lokesh-sparrow

PNPC-MCP-Tally-Prime

update_voucher

DestructiveIdempotent

Update an existing TallyPrime voucher by matching its type, date, and number, replacing ledger entries and narration. Refuses if another voucher shares the same number on that date, preventing wrong-voucher edits.

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

TableJSON Schema
NameRequiredDescriptionDefault
dateYesExisting voucher's date in DD-MM-YYYY format
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.
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')
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. 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"
      +}
  2. 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"
      +]
  3. First observedv1.0.3

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, and the description goes further by disclosing the actual mutation semantics: ledger lines and narration are replaced wholesale, and the debitDescription field note warns that omitting existing descriptions removes them. It also documents the failure mode (refusal on voucher-number collision) and the underlying Tally corruption risk, which an agent could not infer from annotations alone.

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-loads the core operation, then layers matching, mode selection, and collision refusal in a logical order. The parenthetical justification about Tally's Alter lookup ignoring voucher type earns its place by explaining the refusal, though the description is dense and leans on cross-references to create_voucher.

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 20-parameter mutation with annotations present and no output schema, the description covers the key agent-facing concerns: how the target is identified, which mode to use, replacement semantics, and failure behavior. What's missing is anything about success/response shape or partial-failure behavior, but with no output schema that is a minor gap.

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 real meaning beyond the schema by explaining that 'entries' replaces the simple debit/credit/amount mode, that debit and credit legs must balance, and that the three required params form the lookup key. It doesn't add format detail for fields like referenceDate beyond what the schema already says, so it falls short of 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?

States a specific verb and resource ('Update an existing voucher in TallyPrime') plus the exact effect ('replacing its ledger entries and narration'), which cleanly distinguishes it from the sibling create_voucher and from the various register getters. An agent can identify the operation without opening the 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?

Explicitly tells the agent to confirm the target first ('use get_ledger_vouchers or get_vouchers first'), states the matching key (type + date + voucher number must be unique and exact), routes between two input modes (debitLedger/creditLedger/amount vs 'entries'), and gives a when-not condition (refuses if another voucher type shares the number/date). This is close to ideal routing guidance.

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