Skip to main content
Glama
svharivinod

TallyPrime MCP Server

by svharivinod

create_payment_voucher

Record outgoing payments by creating a payment voucher in TallyPrime, debiting an expense or party ledger and crediting a bank or cash ledger.

Instructions

Create a payment voucher in TallyPrime (money going out).

Args: date: Voucher date YYYYMMDD. bank_ledger: Bank or cash ledger to pay from. expense_ledger: Expense or party ledger to debit. amount: Payment amount. narration: Optional description or reference.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes
bank_ledgerYes
expense_ledgerYes
amountYes
narrationNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler that creates a payment voucher. Decorated with @mcp.tool(), it accepts date, bank_ledger, expense_ledger, amount, narration and calls client.create_payment_voucher().
    @mcp.tool()
    async def create_payment_voucher(
        date: str,
        bank_ledger: str,
        expense_ledger: str,
        amount: float,
        narration: str = "",
    ) -> str:
        """
        Create a payment voucher in TallyPrime (money going out).
    
        Args:
            date: Voucher date YYYYMMDD.
            bank_ledger: Bank or cash ledger to pay from.
            expense_ledger: Expense or party ledger to debit.
            amount: Payment amount.
            narration: Optional description or reference.
        """
        try:
            result = await client.create_payment_voucher(
                date=date, bank_ledger=bank_ledger,
                expense_ledger=expense_ledger, amount=amount, narration=narration,
            )
            if result["success"]:
                return f"Payment voucher created. Paid from: {bank_ledger}, To: {expense_ledger}, Amount: {amount:.2f}, Date: {date}"
            return f"Failed: {result['message']}"
        except TallyError as e:
            return f"Error: {e}"
  • TallyClient helper that builds the XML via create_payment_voucher_xml, sends it, parses the response, and checks the import result.
    async def create_payment_voucher(self, **kwargs) -> dict:
        from .xml_builder import create_payment_voucher_xml
        return self._check_import_result(self._parse(await self.send_xml(create_payment_voucher_xml(**kwargs))))
  • XML builder that constructs the TallyPrime Payment voucher XML with expense ledger (debit) and bank ledger (credit) entries.
    def create_payment_voucher_xml(
        date: str,
        bank_ledger: str,
        expense_ledger: str,
        amount: float,
        narration: str = "",
    ) -> str:
        voucher = f"""<VOUCHER ACTION="Create" VCHTYPE="Payment">
              <DATE>{date}</DATE>
              <VOUCHERTYPENAME>Payment</VOUCHERTYPENAME>
              <NARRATION>{narration}</NARRATION>
              <ALLLEDGERENTRIES.LIST>
                <LEDGERNAME>{expense_ledger}</LEDGERNAME>
                <ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>
                <AMOUNT>-{amount}</AMOUNT>
              </ALLLEDGERENTRIES.LIST>
              <ALLLEDGERENTRIES.LIST>
                <LEDGERNAME>{bank_ledger}</LEDGERNAME>
                <ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
                <AMOUNT>{amount}</AMOUNT>
              </ALLLEDGERENTRIES.LIST>
            </VOUCHER>"""
        return _voucher_import_envelope(voucher)
  • Entry point for tool registration. register_all() calls vouchers.register(mcp, client) which registers all voucher tools including create_payment_voucher.
    def register_all(mcp: FastMCP, client: TallyClient):
        company.register(mcp, client)
        ledgers.register(mcp, client)
        vouchers.register(mcp, client)
        reports.register(mcp, client)
  • Server startup: creates FastMCP instance and calls register_all() to register all tools including create_payment_voucher.
    mcp = FastMCP("tallyprime-mcp")
    
    _client = TallyClient(url=TALLY_URL, timeout=TALLY_TIMEOUT)
    register_all(mcp, _client)
Behavior2/5

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

No annotations provided; description only states creation without disclosing side effects, permissions, or return value. Minimal behavioral context beyond the basic action.

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-sentence purpose followed by bulleted args. No superfluous text; every sentence adds value. Front-loaded and efficient.

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

Completeness3/5

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

Covers inputs adequately but lacks preconditions (e.g., ledgers must exist) and error conditions. Output schema exists, so return value details are forgone.

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?

All parameters are described with added semantics: date format YYYYMMDD, ledger roles, and narration optionality. Compensates for 0% schema coverage by adding meaning beyond types.

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?

Description clearly states 'Create a payment voucher in TallyPrime (money going out)', specifying verb and resource. It distinguishes from sibling tools like create_receipt_voucher (money coming in).

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?

Implies usage for outgoing payments via 'money going out', but no explicit when-to-use or when-not-to-use compared to alternative voucher types like journal or purchase vouchers.

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