Skip to main content
Glama
lokesh-sparrow

PNPC-MCP-Tally-Prime

sync_voucher_items_to_sql

Read-only

Pull Tally Prime voucher inventory line items into SQL cache for a date range, enabling direct SQL queries for stock movement, godown-wise, and batch analysis.

Instructions

Pull voucher INVENTORY LINE ITEMS (stock item, qty, rate, amount, godown, batch — one row per item per batch allocation) for one date range into this session's SQL cache, so query_sql can compute movement analysis, godown-wise stock, or batch detail directly. This is the raw data those analyses need — Tally has no exportable 'Movement Analysis'/'Stock Ageing Analysis'/'Godown Summary' report reachable over the gateway (confirmed live against all 138 registered report names, and confirmed live that per-godown $ClosingBalance/SVGODOWNNAME scoping doesn't work either), so this connector doesn't try to replicate those as report tools — pull the line items with this, then write the aggregation as SQL. qty/amount are UNSIGNED as Tally stores them on the inventory entry; use is_deemed_positive together with voucher_type to work out inward vs outward direction. A voucher with no stock items (Payment, Journal, etc.) contributes zero rows, not an empty one. Same chunked, additive-by-date-range model and same timeout caution as sync_vouchers_to_sql — quarterly/monthly chunks for a busy company. Checks which company is actually open in Tally first and clears the whole cache if it's changed since the last sync/query — however that happened, not just via set_company.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesEnd date in DD-MM-YYYY format
fromYesStart date in DD-MM-YYYY format

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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 declare readOnlyHint=true and openWorldHint=false, so the description carries the behavioral burden and delivers far beyond it: unsigned qty/amount semantics, direction logic, zero-rows-not-empty-row edge case for non-stock vouchers, chunked/additive model, timeout caution, and disclosure that the tool checks the open company and clears the entire cache on change. No contradiction with the read-only annotation since the operation mutates only the session cache.

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?

The description is long but front-loaded with the core purpose and field list, then flows through rationale, data semantics, edge cases, and cache behavior in a logical order. The detail about 'confirmed live against all 138 registered report names' and the SVGODOWNNAME scoping check is somewhat verbose, but it earns its place by justifying why no report-style sibling is relevant.

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 2-param tool with no output schema and read-only annotations, the description is thoroughly complete: data fields, direction interpretation, edge cases, chunking, and cache-clearing behavior are all covered. The main gap is that it never names the resulting SQL table(s) or states the sync call's return value, though the explicit reference to the sync_vouchers_to_sql model partially covers this.

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 coverage is 100% — both from and to are documented with format (DD-MM-YYYY), so the baseline is 3. The description adds only modest parameter meaning: the date-range semantics (one date range, additive ranges, chunking advice for sizing). This is helpful but does not substantially deepen understanding of the two parameters beyond the schema.

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 states a specific verb (pull/sync), a specific resource (voucher inventory line items with stock item, qty, rate, amount, godown, batch), and a clear destination (session SQL cache for query_sql). It explicitly differentiates from siblings by noting it is the raw-data source for movement/godown/batch analyses and that report-style siblings cannot provide them because Tally exposes no such report over the gateway.

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?

Explicitly tells the agent when to use this tool: to pull raw line items instead of trying to replicate Movement Analysis/Godown Summary as report tools, with confirmation that no such report exists. It also gives operational guidance (quarterly/monthly chunking for busy companies, same model as sync_vouchers_to_sql) and explains how to derive direction via is_deemed_positive + voucher_type.

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