Skip to main content
Glama
svharivinod

TallyPrime MCP Server

by svharivinod

get_balance_sheet

Retrieve the Balance Sheet from TallyPrime for any specified date. Use this to view financial position at a glance.

Instructions

Get the Balance Sheet from TallyPrime as of a specific date.

Args: as_of_date: Date YYYYMMDD (e.g. '20250331').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
as_of_dateYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool registration (via @mcp.tool()) and handler for 'get_balance_sheet'. This function defines the tool, its docstring/args, calls the TallyClient to fetch data, and returns a formatted JSON string.
    @mcp.tool()
    async def get_balance_sheet(as_of_date: str) -> str:
        """
        Get the Balance Sheet from TallyPrime as of a specific date.
    
        Args:
            as_of_date: Date YYYYMMDD (e.g. '20250331').
        """
        try:
            data = await client.get_balance_sheet(as_of_date)
            return f"Balance Sheet as of {as_of_date}:\n\n" + json.dumps(data, indent=2)
        except TallyError as e:
            return f"Error: {e}"
  • The client-side handler that builds the XML request via get_balance_sheet_xml, sends it to Tally, parses the response XML, and converts it to a Python dict.
    async def get_balance_sheet(self, as_of_date: str) -> dict:
        from .xml_builder import get_balance_sheet_xml
        return self._elem_to_dict(self._parse(await self.send_xml(get_balance_sheet_xml(as_of_date))))
  • Helper function that builds the XML envelope for the Balance Sheet report request, parameterized by as_of_date.
    def get_balance_sheet_xml(as_of_date: str) -> str:
        return f"""<ENVELOPE>
      <HEADER>
        <TALLYREQUEST>Export Data</TALLYREQUEST>
      </HEADER>
      <BODY>
        <EXPORTDATA>
          <REQUESTDESC>
            <REPORTNAME>Balance Sheet</REPORTNAME>
            <STATICVARIABLES>
              <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
              <SVTODATE>{as_of_date}</SVTODATE>
            </STATICVARIABLES>
          </REQUESTDESC>
        </EXPORTDATA>
      </BODY>
    </ENVELOPE>"""
Behavior2/5

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

No annotations are provided, and the description lacks behavioral disclosure beyond stating it retrieves a balance sheet. It does not mention that it is a read-only operation, response format, or any potential side effects.

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

Conciseness5/5

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

The description is very concise: two sentences plus an args block. It is front-loaded with the main purpose and immediately provides parameter details.

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?

Given the presence of an output schema, the description does not need to explain return values. It adequately covers the tool's input and purpose, though it could briefly mention what the balance sheet includes.

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?

The description adds value by specifying the exact format for the as_of_date parameter (YYYYMMDD) and providing an example, which is not present in the input schema. Schema description coverage is 0%, so this compensates well.

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 clearly states the action (Get), the resource (Balance Sheet), and the context (from TallyPrime as of a specific date). It distinguishes itself from sibling tools like get_profit_loss or get_trial_balance.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention when not to use it or suggest other tools for different scenarios.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/svharivinod/tallyprime-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server