Skip to main content
Glama
ComplyEaze Bridge: TallyPrime MCP server for Claude Desktop

ComplyEaze Bridge: TallyPrime MCP server for Claude Desktop

Official

profit_and_loss

Read-only

Generate a TallyPrime Profit and Loss statement for a company and date range, derived from the Trial Balance with validation checks and clear not-established reasons.

Instructions

Return the Profit and Loss for a date range, derived from Tally's native Trial Balance: one line per reserved P&L primary group (Sales Accounts, Direct Incomes, Purchase Accounts, Direct Expenses, Indirect Incomes, Indirect Expenses), each the window's signed debit plus credit movement (a debit negative), with gross_result and net_result (a profit positive). The top-level lines is null while net_result is not established, so a derived line is never shown as the statement. Reads the Trial Balance, the group tree, Tally's own Balance Sheet and its Profit and Loss inside one company, mode and book-extent bracket; requires one INR currency master and supported date boundaries. Each line's amount has sum (of the amounts Tally returned), present_count and empty_count. A result is established only if every ledger is classified (a ledger under a user-created primary group, or whose group chain is incomplete, is listed in unclassified, up to 100, with unclassified_total), no Stock-in-Hand ledger carries an amount, and Tally's own Balance Sheet for the window ties line for line to the derived one (balance_sheet_gate). Otherwise it is not_established with a reason (unclassified_ledger_carries_an_amount, closing_stock_not_derivable_from_trial_balance, profit_and_loss_ledger_not_returned, tally_balance_sheet_differs, or for gross and net tally_profit_and_loss_differs); for the two differs reasons, lines names the lines that did not tie. On the one book measured, Tally's own Balance Sheet export left out the Difference in opening balances line its screen showed: when the export's lines do not sum to zero the result carries tally_balance_sheet_sides (the credit and debit totals), the first line says so, and nothing is established (tally_balance_sheet_does_not_balance when no other reason applies). The top-level state is observed only while gross_result and net_result are both established, else not_established with the nested reason. With integrated inventory and no opening stock, Tally's own Less: Closing Stock is used and shown in closing_stock (applied, declined with why, or null), only if that one figure ties Current Assets, the Profit & Loss A/c line and the Cost of Sales heading, and the lines sum to zero (one book seen); Add: Purchase Accounts is then Purchase Accounts. Otherwise a book with stock items refuses. A Tally line with an amount and no derived counterpart (a heading) refuses. Tally's statements name no company; the checks around the read bind them. The gate has been measured over one full year on one book and one month on another; a window spanning more than one financial year is unmeasured. Tally's own Profit and Loss is read too and compared by display name in tie_out (matched, matched_empty_as_zero, differs or not_compared). Gross and net are also refused as tally_profit_and_loss_differs unless it ties: no line differs, no derived line is missing from it, and no line of its with an amount is uncompared, except its Cost of Sales : heading while that equals the derived Purchase Accounts plus Direct Expenses, less any closing stock used, exactly. Each call appends metadata-only receipt lines (tool, company, counts, request and response fingerprints; no book content) to ComplyEaze Bridge's local log on this computer; it writes nothing to Tally.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "company_guid": "<company_guid>",
      "from": "<from>",
      "to": "<to>"
    },
    "name": "profit_and_loss"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesThe last day of the date range, included (YYYYMMDD or YYYY-MM-DD).
fromYesThe first day of the date range, included (YYYYMMDD or YYYY-MM-DD).
company_guidYesThe company's company_guid, as list_companies returns it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.4.3
    • addedInput schema / properties / company_guid / description
      Added value: +"The company's company_guid, as list_companies returns it."
    • addedInput schema / properties / from / description
      Added value: +"The first day of the date range, included (YYYYMMDD or YYYY-MM-DD)."
    • addedInput schema / properties / to / description
      Added value: +"The last day of the date range, included (YYYYMMDD or YYYY-MM-DD)."
  2. First observedv0.4.1

TDQS

A3.8/5.0
Behavior5/5

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

Well beyond the annotations, the description discloses the full refusal taxonomy (unclassified_ledger_carries_an_amount, closing_stock_not_derivable_from_trial_balance, tally_balance_sheet_differs, etc.), the balance-sheet and P&L tie-out gates, the Conditions under which lines is null, the closing-stock handling, and the measured-coverage limitation. It also discloses a side effect the annotations do not convey: metadata-only receipt lines appended to a local log, with nothing written to Tally.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded, but the body is a single dense block of run-on sentences covering gates, refusal codes, closing stock, and tie-out internals. Much of this is substantive given the absent output schema, yet it is unsegmented and far harder to parse than its length requires.

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 carries the full burden of describing return shape (lines, gross_result, net_result, state, reason, closing_stock, tie_out, tally_balance_sheet_sides) and it does so exhaustively, alongside preconditions and failure modes. An agent has everything needed to interpret a result or a refusal.

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 description coverage is 100% and the three parameters (company_guid, from, to) are fully documented in the schema, so the baseline is 3. The description reinforces that the window is a date range inside one company but adds no format or boundary semantics beyond what the schema already states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence names a specific verb and resource ('Return the Profit and Loss for a date range') and pins down the derivation source (Tally's native Trial Balance) with one line per reserved P&L primary group, which implicitly separates it from the raw trial_balance sibling. It stops short of naming an explicit alternative, so it is clear but not fully sibling-differentiating.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Preconditions are stated (one INR currency master, supported date boundaries, single company/mode/book-extent bracket) and there is a caveat that a window spanning more than one financial year is unmeasured. However, there is no explicit guidance on when to choose this over balance_sheet or trial_balance, so selection is left to inference from the derivation note.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.