Skip to main content
Glama
svharivinod

TallyPrime MCP Server

by svharivinod

get_all_groups

Retrieve all account groups defined in TallyPrime to manage and view your ledger categories.

Instructions

Get all account groups defined in TallyPrime.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler function for 'get_all_groups'. Calls client.get_all_groups() and formats the results as a string listing group names (with optional parent). Registered via @mcp.tool() decorator inside the register() function.
    @mcp.tool()
    async def get_all_groups() -> str:
        """Get all account groups defined in TallyPrime."""
        try:
            groups = await client.get_all_groups()
            if not groups:
                return "No groups found."
            text = f"Found {len(groups)} groups:\n\n"
            for g in groups:
                parent = f"  (under: {g['parent']})" if g["parent"] else ""
                text += f"  * {g['name']}{parent}\n"
            return text
        except TallyError as e:
            return f"Error: {e}"
  • Client method that sends the XML request to TallyPrime to fetch all groups. Builds the XML via get_all_groups_xml(), sends it, parses the response, and extracts group name + parent for each GROUP element.
    async def get_all_groups(self) -> list:
        from .xml_builder import get_all_groups_xml
        raw = await self.send_xml(get_all_groups_xml())
        root = self._parse(raw)
        return [{"name": (g.findtext("NAME") or g.get("NAME") or "").strip(), "parent": (g.findtext("PARENT") or "").strip()} for g in root.iter("GROUP")]
  • XML builder function that constructs the TallyPrime XML request to fetch all groups. Uses REPORTNAME 'List of Accounts' with ACCOUNTTYPE 'Groups' to filter for groups only.
    def get_all_groups_xml() -> str:
        return """<ENVELOPE>
      <HEADER>
        <TALLYREQUEST>Export Data</TALLYREQUEST>
      </HEADER>
      <BODY>
        <EXPORTDATA>
          <REQUESTDESC>
            <REPORTNAME>List of Accounts</REPORTNAME>
            <STATICVARIABLES>
              <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
              <ACCOUNTTYPE>Groups</ACCOUNTTYPE>
            </STATICVARIABLES>
          </REQUESTDESC>
        </EXPORTDATA>
      </BODY>
    </ENVELOPE>"""
  • The tool is registered via the @mcp.tool() decorator applied to the get_all_groups async function inside the register() function which receives the MCP server instance.
    @mcp.tool()
    async def get_all_groups() -> str:
        """Get all account groups defined in TallyPrime."""
        try:
            groups = await client.get_all_groups()
            if not groups:
                return "No groups found."
            text = f"Found {len(groups)} groups:\n\n"
            for g in groups:
                parent = f"  (under: {g['parent']})" if g["parent"] else ""
                text += f"  * {g['name']}{parent}\n"
            return text
        except TallyError as e:
            return f"Error: {e}"
Behavior3/5

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

With no annotations, the description carries full burden. It discloses read-only behavior but lacks details like return format or that it returns all groups without filtering.

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?

One short, direct sentence with no unnecessary words, perfectly front-loaded.

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 tool's simplicity (no parameters, output schema exists), the description is sufficient. Could mention that it returns all groups without filtering, but not essential.

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 tool has zero parameters, and schema coverage is 100%, so baseline 4 applies. The description does not need to add parameter meaning.

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 tool retrieves all account groups in TallyPrime, using a specific verb and resource, and distinguishes it from sibling tools like get_all_ledgers.

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?

No guidance is provided on when to use this tool versus alternatives (e.g., get_all_ledgers, get_daybook), nor any context for typical workflow integration.

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