get_ledgers
Retrieve TallyPrime ledger accounts to find exact names before creating vouchers or new ledgers; omit query for all, use query for fuzzy matches.
Instructions
Get ledgers (accounts) from TallyPrime. Omit query to get every ledger. Pass query to instead get a fuzzy-ranked shortlist of the closest-matching ledger names — useful when you have a rough or partial name (e.g. from a client document) and need Tally's exact spelling before creating a voucher or a new ledger, without pulling and scanning the entire ledger list yourself. Matches on exact/prefix/substring, then falls back to a loose in-order character match for abbreviations and typos (e.g. 'vro' finds 'VRO Technology'). Returns at most the top 20 matches, ranked best first; an empty result means create the ledger — nothing close enough exists yet. Each ledger includes VATTINNUMBER, VATDEALERTYPE, STATE, and COUNTRY (the values set via create_ledger's trn/vatDealerType/state/country fields, blank if never set), plus GSTIN, PAN, GSTREGISTRATIONTYPE, GSTTYPEOFSUPPLY, and CONTACTPERSON (set via create_ledger's gstin/pan/gstRegistrationType/gstTypeOfSupply/contactPerson fields — GSTIN/PAN/GSTREGISTRATIONTYPE are India's fields, distinct from trn/VATDEALERTYPE which are UAE-specific; a company only uses one country's set or the other, not both) — check the relevant ones before creating a Sales/Purchase invoice (or Credit/Debit Note, Delivery/Receipt Note) for that party: Tally itself defaults a new invoice's Buyer/Place-of-Supply details from the party ledger's own master data, so use these same values for buyerTrn/buyerState/buyerCountry rather than leaving them blank or guessing. Only ask the user to confirm instead of defaulting when the party has multiple registered delivery locations/addresses and it's genuinely unclear which one applies to this specific transaction (confirmed live: a real customer ledger can carry dozens of named addresses, and one invoice's Buyer address and Consignee/Ship-to address can legitimately differ from both the ledger's default and each other).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Rough or partial ledger name to fuzzy-match against. Omit to get the full ledger list instead. |