Skip to main content
Glama
lokesh-sparrow

PNPC-MCP-Tally-Prime

create_sales_invoice

Create itemized sales invoices in TallyPrime with stock item lines, per-line sales ledgers, optional VAT/tax, and bill-wise references.

Instructions

Create an item-invoice Sales voucher in TallyPrime — a real invoice with stock item lines (quantity, rate), each posted to its own Sales ledger, plus one optional VAT/tax line on the total. Distinct from create_voucher, which only supports plain ledger-to-ledger entries with no stock items. WARNING (confirmed live): 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 (returns 'Cannot be deleted!' even with zero balance) — 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'.
buyerTrnNoThe buyer's Tax Registration Number as it should appear on THIS invoice — a per-voucher snapshot (Tally's TRADERCONSVATTINNO/BASICBUYERSSALESTAXNO fields), separate from and not inherited from the party ledger's own trn (create_ledger). Reverse-engineered from a real Tax Invoice export: leaving this unset is exactly what leaves the invoice's Party Details showing a blank TRN even when the party ledger has one set — always pass this explicitly for a UAE VAT tax invoice.
narrationNoNarration / description for the invoice
referenceNoFree-text reference for this invoice (Tally's voucher-level REFERENCE field), e.g. a purchase order or bill number the customer quoted.
vatLedgerNoDefault VAT/tax ledger applied to any item that doesn't set its own vatLedger (optional — omit for a fully non-taxable invoice).
buyerStateNoThe buyer's Emirate/state as it should appear on THIS invoice's Party Details (voucher-level STATENAME) — not inherited from the party ledger master. Match the company's existing convention (check get_company_info or an existing invoice).
partyLedgerYesCustomer ledger name (the party being invoiced)
buyerCountryNoThe buyer's country as it should appear on THIS invoice's Party Details (voucher-level COUNTRYOFRESIDENCE). Plain free text, e.g. 'UAE'.
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) — for a standard domestic B2B supply of services this is normally the SUPPLIER's own Emirate (check get_company_info), not the buyer's. Required for a compliant UAE tax invoice; omitting it is what left this blank on a real invoice this was reverse-engineered from.

Schema Changelog

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

  1. Changed14 schema fields changedv1.11.2
    • addedInput schema / properties / buyerCountry
      Added value: +{
      +  "description": "The buyer's country as it should appear on THIS invoice's Party Details (voucher-level COUNTRYOFRESIDENCE). Plain free text, e.g. 'UAE'.",
      +  "type": "string"
      +}
    • addedInput schema / properties / buyerState
      Added value: +{
      +  "description": "The buyer's Emirate/state as it should appear on THIS invoice's Party Details (voucher-level STATENAME) — not inherited from the party ledger master. Match the company's existing convention (check get_company_info or an existing invoice).",
      +  "type": "string"
      +}
    • addedInput schema / properties / buyerTrn
      Added value: +{
      +  "description": "The buyer's Tax Registration Number as it should appear on THIS invoice — a per-voucher snapshot (Tally's TRADERCONSVATTINNO/BASICBUYERSSALESTAXNO fields), separate from and not inherited from the party ledger's own trn (create_ledger). Reverse-engineered from a real Tax Invoice export: leaving this unset is exactly what leaves the invoice's Party Details showing a blank TRN even when the party ledger has one set — always pass this explicitly for a UAE VAT tax invoice.",
      +  "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) — for a standard domestic B2B supply of services this is normally the SUPPLIER's own Emirate (check get_company_info), not the buyer's. Required for a compliant UAE tax invoice; omitting it is what left this blank on a real invoice this was reverse-engineered from.",
      +  "type": "string"
      +}
    • addedInput schema / properties / reference
      Added value: +{
      +  "description": "Free-text reference for this invoice (Tally's voucher-level REFERENCE field), e.g. a purchase order or bill number the customer quoted.",
      +  "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"
      +}
    • changedInput schema / properties / vatLedger / description
      Previous value: -"VAT/tax ledger to apply against the invoice total (optional — omit for a non-taxable invoice)."New value: +"Default VAT/tax 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.6/5.0
Behavior5/5

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

Annotations only say readOnlyHint=false and destructiveHint=false, which is thin; the description carries the full burden and delivers exceptional value. It discloses a confirmed-live behavioral hazard — vouchers becoming undeletable via API when shared party/stock items are used across Sales and Purchase invoices — plus the exact recovery path (Company Data → Rewrite) and the confirmation that it is not a permanent lock.

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?

Three sentences, zero filler, and the core purpose is front-loaded before the sibling distinction and the warning. The warning is long but every word earns its place — it conveys a live-confirmed failure mode and its workaround, which is exactly the kind of content that must not be trimmed.

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 16-parameter mutation tool with no output schema, the description covers core function, sibling differentiation, and the critical lock hazard; the schema covers every parameter exhaustively. The only gap is that no explicit success-return shape is stated, though the schema's CREATED:0/EXCEPTIONS:1 hints let an agent infer the Tally gateway response pattern.

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%, so the schema already documents all 16 parameters in rich detail (including failure modes like the godown silent fail), putting this at the baseline 3. The tool description adds mild structural meaning — per-line salesLedger vs. one VAT line on the total — but does not meaningfully compensate beyond what the schema already provides.

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 ('Create an item-invoice Sales voucher in TallyPrime') with concrete detail about what it produces: stock item lines with quantity/rate, each posted to its own Sales ledger, plus an optional VAT/tax line. It explicitly names the confusable sibling and its limitation ('Distinct from create_voucher, which only supports plain ledger-to-ledger entries with no stock items'), so an agent can tell it apart without opening schemas.

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 when/hen-not: use this for item-invoices with stock item lines, and names create_voucher as the alternative for plain ledger-to-ledger entries. The live warning about the same party/stock item appearing in BOTH a Sales and Purchase item-invoice also implicitly guides when NOT to combine this tool with create_purchase_invoice on the same masters.

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