Skip to main content
Glama
lokesh-sparrow

PNPC-MCP-Tally-Prime

sync_voucher_ledger_entries_to_sql

Read-only

Sync voucher ledger lines for a date range into the SQL cache to break down ledger balances by voucher, including ledger, signed amount, cost centre, and bill allocation.

Instructions

Pull voucher LEDGER LINES (which ledger each voucher posted to, the amount, cost centre, and bill allocation — one row per ledger line per bill allocation) for one date range into this session's SQL cache. This is the piece get_vouchers/sync_vouchers_to_sql can't give you — those return only each voucher's single overall total, not which ledgers it actually posted to and for how much. Use this whenever a ledger's balance needs to be broken down by the vouchers that make it up — e.g. a combined VAT ledger split into Output vs Input (GROUP BY ledger, voucher_type), or reconciling a party ledger's movements voucher by voucher. amount is SIGNED (negative for a debit line, positive for a credit line — confirmed live: a Sales invoice's party ledger line comes back negative while its Sales/VAT lines come back positive, summing to zero across the voucher) — sum it directly. Same chunked, additive-by-date-range model and same timeout caution as sync_vouchers_to_sql/sync_voucher_items_to_sql — quarterly/monthly chunks for a busy company. If you switch companies (set_company), the cache is cleared automatically, so re-sync before querying again.

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.12.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare read-only and closed-world; the description adds substantial behavioral context beyond that: the signed amount convention (negative debit, positive credit, verified live), the chunked additive-by-date-range model, a timeout caution, and the fact that set_company clears the cache so a re-sync is needed.

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?

Purpose and grain are front-loaded, followed by differentiation, usage cases, and operational caveats. It is dense and long, but nearly every sentence carries distinct value; only the live-confirmation aside is slightly expendable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description still conveys the returned row shape, the signed-amount semantics, the cache-invalidation behavior, and the chunking strategy. An agent has everything needed to call and interpret it correctly.

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% and both parameters (from, to) are documented with DD-MM-YYYY format in the schema. The description references a date range and chunking but adds no format or syntax detail beyond the schema, so the baseline of 3 applies.

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 ('Pull voucher LEDGER LINES ... into this session's SQL cache') and defines the exact grain ('one row per ledger line per bill allocation'). It explicitly separates itself from siblings by naming what get_vouchers/sync_vouchers_to_sql cannot provide (only the voucher's single overall total).

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 trigger ('Use this whenever a ledger's balance needs to be broken down by the vouchers that make it up') and concrete alternatives to reach for instead (get_vouchers, sync_vouchers_to_sql). It also provides two worked scenarios (VAT Output vs Input split, reconciling a party ledger movement by movement).

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