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

PNPC-MCP-Tally-Prime

update_purchase_invoice

DestructiveIdempotent

Updates an existing TallyPrime purchase invoice by replacing its item lines, party ledger, and narration after confirming the voucher is unique by date and number.

Instructions

Update an existing item-invoice Purchase voucher in TallyPrime, replacing its item lines, party, and narration. Same fields as create_purchase_invoice, plus voucherNumber. Matched by date + voucher number — use get_ledger_vouchers or get_vouchers first to confirm it exists and is unique. 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 invoice's date in DD-MM-YYYY format
itemsYesOne entry per invoice line — replaces all existing lines.
billNameNo
billTypeNo
buyerTrnNoYOUR OWN company's TRN on this invoice — same voucher-level field as create_purchase_invoice's buyerTrn.
narrationNoNew narration / description for the invoice
referenceNoFree-text reference for this invoice (Tally's voucher-level REFERENCE field).
vatLedgerNoDefault VAT ledger for items without their own override.
buyerStateNoYOUR OWN company's Emirate/state on this invoice's Party Details.
partyLedgerYesSupplier ledger name (the party being paid)
supplierTrnNoThe supplier's (party's) TRN on this invoice — same voucher-level field as create_purchase_invoice's supplierTrn. Distinct from buyerTrn.
voucherTypeNoVoucher type of the existing voucher, if it isn't the default 'Purchase' (e.g. 'Tax Invoice'). Used to find it and to check no other voucher shares its number.
buyerCountryNoYOUR OWN company's country on this invoice's Party Details.
referenceDateNoDate for the reference above, in DD-MM-YYYY format.
voucherNumberYesExact voucher number of the invoice to update
vatRatePercentNoDefault VAT rate. Required if vatLedger is set.
placeOfSupplyCountryNoUAE VAT Place of Supply Country for this invoice.
placeOfSupplyEmirateNoUAE VAT Place of Supply Emirate for this invoice.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.14.0
    • addedInput schema / properties / items / items / properties / description
      Added value: +{
      +  "description": "Description lines shown under this stock line on the invoice, one array entry per line (e.g. a size, colour or service period). Optional.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / voucherType
      Added value: +{
      +  "description": "Voucher type of the existing voucher, if it isn't the default 'Purchase' (e.g. 'Tax Invoice'). Used to find it and to check no other voucher shares its number.",
      +  "type": "string"
      +}
  2. Addedv1.11.2

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only say destructive=true, idempotent=true and readOnly=false; the description adds what is actually destroyed (existing item lines are wholly replaced), how the target is resolved (date + voucher number), and a live-confirmed silent-corruption hazard where Tally's Alter lookup ignores voucher type — plus the guard that refuses rather than corrupting. That is exactly the behavioral context annotations cannot express.

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?

Four sentences, front-loaded with purpose before the matching rule and the collision caveat, and each sentence carries distinct information. The parenthetical about Tally's Alter lookup is slightly verbose but it justifies a non-obvious safety behavior, so it largely earns its place.

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 an 18-parameter destructive mutation with no output schema, the description covers targeting, replacement scope, prerequisites and the failure mode. It still leaves the agent guessing about the success response and about how omitted optional fields are treated on an update, which is a meaningful gap for a replace-style operation.

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 already 89%, so the baseline is 3; the description adds real meaning on top by explaining that voucherNumber is matched together with date, that voucherType is used both for lookup and for the collision check, and by equating the remaining fields to create_purchase_invoice. It does not explain replacement semantics for optional voucher-level fields (e.g. whether omitting narration clears it), which keeps it below 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 item-invoice Purchase voucher in TallyPrime') and even names the scope of replacement (item lines, party, narration). It positions itself relative to a sibling by saying it takes 'Same fields as create_purchase_invoice, plus voucherNumber', so an agent can distinguish create vs. update 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit prerequisite workflow: call get_ledger_vouchers or get_vouchers first to confirm the voucher exists and that date + number is unique, and what to do on a type collision. It does not contrast itself with the generic update_voucher sibling or say when a different voucher-update tool is preferable, so it stops short of the full when/when-not/alternatives bar.

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