Skip to main content
Glama
lokesh-sparrow

PNPC-MCP-Tally-Prime

sync_vouchers_to_sql

Read-only

Pull voucher headers for a date range into an in-memory SQL cache so reports can aggregate data without re-fetching from Tally. Call per chunk to build full history for the open company.

Instructions

Pull voucher HEADERS (date, type, number, party ledger, amount, narration — not line items) for one date range into this session's SQL cache (in-memory, gone when the session ends), so query_sql can aggregate/report on them (e.g. sales by customer by month) without re-fetching from Tally. Call this once per chunk to build up full multi-year history for the CURRENTLY OPEN company within this session — re-running for the SAME range just refreshes it (safe to re-run), and each call only touches vouchers within its own date range, so calling it for 2024 then 2025 gives you both, not just the latest. 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 — so a prior company's vouchers never silently mix into this one's results. IMPORTANT: pick a chunk size that won't time out — a full year (~7,500 vouchers here) took ~6s against the 10s request timeout; prefer quarterly or monthly chunks for a busy company, and back off further if a call times out. Does not include stock item / ledger line detail (see get_ledger_vouchers/get_vouchers for that).

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.7/5.0
Behavior5/5

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

Annotations already provide readOnlyHint=true, but the description adds substantial behavioral context beyond that: the cache is session-scoped and volatile, re-running the same range is idempotent, the entire cache is cleared if the open company changed since the last sync/query, and calls accumulate across date ranges rather than replacing prior data. The timeout risk and chunk-backoff guidance are also valuable operational disclosures.

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 (5+ dense sentences) but every sentence carries distinct behavioral weight: scope, caching semantics, idempotency, accumulation, cache invalidation, timeout, and alternatives. It is front-loaded with the core purpose and organized logically. Minor redundancy ('re-running ... just refreshes it (safe to re-run)') is the only waste.

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 tool with complex stateful behavior (session cache, company-change invalidation, timeout risk, chunking), the description is remarkably complete: it covers inputs, side effects, failure-mode risk, and alternative tools. The only gap is not describing what the call directly returns or how success is confirmed, but since the tool's purpose is the cache-population side effect and no output schema exists, this is a minor omission.

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

Parameters4/5

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

Schema coverage is 100% for the two date parameters with DD-MM-YYYY format, so the baseline is 3. The description adds meaningful semantics beyond the schema: the parameters define a chunk of a larger history build, calling 2024 then 2025 accumulates both ranges, and the range size directly maps to timeout risk. This elevates it above the baseline.

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 names a specific verb+resource ('Pull voucher HEADERS ... into this session's SQL cache') and enumerates exactly which fields are included (date, type, number, party ledger, amount, narration) and excluded (line items). It clearly distinguishes itself from siblings like sync_voucher_items_to_sql, sync_voucher_ledger_entries_to_sql, and get_vouchers by stating its header-only scope.

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?

Explicit when-to-use guidance is given: 'Call this once per chunk to build up full multi-year history,' with concrete chunk size advice tied to a timeout measurement (~7,500 vouchers took ~6s against a 10s timeout, prefer quarterly/monthly). It names alternatives for the excluded detail ('see get_ledger_vouchers/get_vouchers for that') and explains the downstream consumer (query_sql).

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