Skip to main content
Glama
lokesh-sparrow

PNPC-MCP-Tally-Prime

create_purchase_invoice

Record supplier purchase invoices as item-voucher entries in TallyPrime, with stock item lines, quantities, rates, and optional VAT/tax postings.

Instructions

Create an item-invoice Purchase voucher in TallyPrime — mirror of create_sales_invoice for the buying side. A real invoice with stock item lines (quantity, rate), each posted to its own Purchase ledger, plus one optional VAT/tax line on the total. WARNING (confirmed live, same as create_sales_invoice): if the same party ledger or stock item is used in BOTH a Sales and a Purchase item-invoice, it can become undeletable via the API afterward — using it in only one of the two is fine and stays deletable. If it does happen, running Company Data → Rewrite in Tally itself clears it (confirmed live) — this is not a permanent lock.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYesInvoice date in DD-MM-YYYY format
itemsYesOne entry per invoice line.
billNameNoBill reference name for bill-wise tracking (requires the party ledger's maintainBillWise to be on). Omit if not using bill-wise tracking.
billTypeNoDefaults to 'New Ref'.
buyerTrnNoYOUR OWN company's TRN, as it should appear on this purchase invoice (Tally's BASICBUYERSSALESTAXNO field) — you are the buyer on a purchase. Check get_company_info or an existing purchase invoice for the correct value; this is normally constant across all purchase invoices for one company.
narrationNoNarration / description for the invoice
referenceNoFree-text reference for this invoice (Tally's voucher-level REFERENCE field) — typically the supplier's own bill/invoice number.
vatLedgerNoDefault Input VAT ledger applied to any item that doesn't set its own vatLedger (optional — omit for a fully non-taxable invoice).
buyerStateNoYOUR OWN company's Emirate/state on this invoice's Party Details (voucher-level STATENAME) — you are the buyer on a purchase. Normally constant; check get_company_info.
partyLedgerYesSupplier ledger name (the party being paid)
supplierTrnNoThe supplier's (party's) TRN as it should appear on THIS invoice — Tally's TRADERCONSVATTINNO field. NOTE the asymmetry vs create_sales_invoice: on a purchase, the party is the supplier, not the buyer, so this is a distinct field from buyerTrn below (they held different real values in a reverse-engineered example — do not set them to the same value).
buyerCountryNoYOUR OWN company's country on this invoice's Party Details (voucher-level COUNTRYOFRESIDENCE). Normally constant; check get_company_info.
referenceDateNoDate for the reference above, in DD-MM-YYYY format. Independent of the invoice's own date.
voucherNumberNoExplicit voucher number. Normally omit this and let Tally auto-number — but some Tally configurations (confirmed live: after a Company Data → Rewrite in at least one case) stop auto-numbering item-invoice vouchers via the XML gateway and fail with a blank EXCEPTIONS:1/no error text unless a number is given explicitly. If a create call fails with no error text, check get_vouchers for the highest existing number of this voucher type and retry with voucherNumber set to the next one.
vatRatePercentNoDefault VAT rate as a percentage, e.g. 5. Required if vatLedger is set. Items with mixed rates can override this per-line.
placeOfSupplyCountryNoUAE VAT Place of Supply Country (Tally's PLACEOFSUPPLYCOUNTRY field), e.g. 'UAE'.
placeOfSupplyEmirateNoUAE VAT Place of Supply Emirate for this invoice (Tally's EMIRATEPOS field).

Schema Changelog

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

  1. Changed15 schema fields changedv1.11.2
    • addedInput schema / properties / buyerCountry
      Added value: +{
      +  "description": "YOUR OWN company's country on this invoice's Party Details (voucher-level COUNTRYOFRESIDENCE). Normally constant; check get_company_info.",
      +  "type": "string"
      +}
    • addedInput schema / properties / buyerState
      Added value: +{
      +  "description": "YOUR OWN company's Emirate/state on this invoice's Party Details (voucher-level STATENAME) — you are the buyer on a purchase. Normally constant; check get_company_info.",
      +  "type": "string"
      +}
    • addedInput schema / properties / buyerTrn
      Added value: +{
      +  "description": "YOUR OWN company's TRN, as it should appear on this purchase invoice (Tally's BASICBUYERSSALESTAXNO field) — you are the buyer on a purchase. Check get_company_info or an existing purchase invoice for the correct value; this is normally constant across all purchase invoices for one company.",
      +  "type": "string"
      +}
    • addedInput schema / properties / items / items / properties / batchName
      Added value: +{
      +  "description": "Real batch/lot number for this line, if the item has batch tracking. Defaults to 'Primary Batch'.",
      +  "type": "string"
      +}
    • addedInput schema / properties / items / items / properties / discountPercent
      Added value: +{
      +  "description": "Discount percentage applied to this line's amount (e.g. 10 for 10% off). Optional.",
      +  "type": "number"
      +}
    • addedInput schema / properties / items / items / properties / vatLedger
      Added value: +{
      +  "description": "Per-item VAT ledger override, if this line has a different tax rate than the invoice default. Requires vatRatePercent.",
      +  "type": "string"
      +}
    • addedInput schema / properties / items / items / properties / vatRatePercent
      Added value: +{
      +  "description": "Per-item VAT rate override, e.g. 5. Required if this item's vatLedger is set.",
      +  "type": "number"
      +}
    • addedInput schema / properties / placeOfSupplyCountry
      Added value: +{
      +  "description": "UAE VAT Place of Supply Country (Tally's PLACEOFSUPPLYCOUNTRY field), e.g. 'UAE'.",
      +  "type": "string"
      +}
    • addedInput schema / properties / placeOfSupplyEmirate
      Added value: +{
      +  "description": "UAE VAT Place of Supply Emirate for this invoice (Tally's EMIRATEPOS field).",
      +  "type": "string"
      +}
    • addedInput schema / properties / reference
      Added value: +{
      +  "description": "Free-text reference for this invoice (Tally's voucher-level REFERENCE field) — typically the supplier's own bill/invoice number.",
      +  "type": "string"
      +}
    • addedInput schema / properties / referenceDate
      Added value: +{
      +  "description": "Date for the reference above, in DD-MM-YYYY format. Independent of the invoice's own date.",
      +  "type": "string"
      +}
    • addedInput schema / properties / supplierTrn
      Added value: +{
      +  "description": "The supplier's (party's) TRN as it should appear on THIS invoice — Tally's TRADERCONSVATTINNO field. NOTE the asymmetry vs create_sales_invoice: on a purchase, the party is the supplier, not the buyer, so this is a distinct field from buyerTrn below (they held different real values in a reverse-engineered example — do not set them to the same value).",
      +  "type": "string"
      +}
    • changedInput schema / properties / vatLedger / description
      Previous value: -"Input VAT/tax ledger to apply against the invoice total (optional — omit for a non-taxable invoice)."New value: +"Default Input VAT ledger applied to any item that doesn't set its own vatLedger (optional — omit for a fully non-taxable invoice)."
    • changedInput schema / properties / vatRatePercent / description
      Previous value: -"VAT rate as a percentage, e.g. 5. Required if vatLedger is set."New value: +"Default VAT rate as a percentage, e.g. 5. Required if vatLedger is set. Items with mixed rates can override this per-line."
    • addedInput schema / properties / voucherNumber
      Added value: +{
      +  "description": "Explicit voucher number. Normally omit this and let Tally auto-number — but some Tally configurations (confirmed live: after a Company Data → Rewrite in at least one case) stop auto-numbering item-invoice vouchers via the XML gateway and fail with a blank EXCEPTIONS:1/no error text unless a number is given explicitly. If a create call fails with no error text, check get_vouchers for the highest existing number of this voucher type and retry with voucherNumber set to the next one.",
      +  "type": "string"
      +}
  2. Addedv1.0.4

TDQS

A4.4/5.0
Behavior5/5

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

The annotations provide little behavioral signal because all hints are false, so the description carries the burden. It does this exceptionally well by disclosing a confirmed live side effect: using the same party ledger or stock item in both Sales and Purchase item-invoices can make vouchers undeletable via the API. It also gives a concrete remediation path and clarifies the issue is not permanent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with purpose, then moves to a clearly marked warning section. Every sentence earns its place, especially the warning, which provides confirmed live testing context and a workaround. There is no filler or repetition.

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?

Given the complex 17-parameter surface, the description plus the exhaustive schema cover the tool well and highlight the most critical behavioral caveat. However, with no output schema, the description does not state what a successful call returns or how the agent should confirm the voucher was created, which leaves a small but real completeness gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and each parameter already has a rich, field-level explanation. The tool description adds useful high-level context about item lines and ledger posting, but it does not add meaning to individual parameters beyond the schema. This matches the baseline for fully covered schemas.

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 clearly states the action and resource: 'Create an item-invoice Purchase voucher in TallyPrime'. It also distinguishes itself from the closely related sibling by labeling it the buying-side mirror of create_sales_invoice, and it adds concrete structural detail about item lines, Purchase ledgers, and a VAT/tax line.

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?

The description provides clear context: this is the tool for purchase-side item-invoices, positioned as the counterpart to create_sales_invoice. However, it does not explicitly state when not to use it or name alternatives like generic create_voucher for other voucher types, so it stops short of full exclusion guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lokesh-sparrow/PNPC-MCP-Tally-Prime'

If you have feedback or need assistance with the MCP directory API, please join our Discord server