get_ledgers
Retrieve TallyPrime ledgers to verify exact account names. Pass a rough or partial name for ranked closest matches; omit query for full list. Empty results signal the ledger does not exist yet.
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, STATE, and COUNTRY (the values set via create_ledger's trn/state/country fields, blank if never set) — check these 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. |