Skip to main content
Glama
svharivinod

TallyPrime MCP Server

by svharivinod

create_journal_voucher

Create journal vouchers for adjustment or contra entries in TallyPrime by specifying date, ledgers, amount, and optional narration.

Instructions

Create a journal voucher in TallyPrime (adjustment or contra entry).

Args: date: Voucher date YYYYMMDD. debit_ledger: Ledger to debit. credit_ledger: Ledger to credit. amount: Journal amount. narration: Optional description.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes
debit_ledgerYes
credit_ledgerYes
amountYes
narrationNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for create_journal_voucher. Decorated with @mcp.tool(), it accepts date, debit_ledger, credit_ledger, amount, and optional narration. Calls client.create_journal_voucher() and returns a success/failure message.
    @mcp.tool()
    async def create_journal_voucher(
        date: str,
        debit_ledger: str,
        credit_ledger: str,
        amount: float,
        narration: str = "",
    ) -> str:
        """
        Create a journal voucher in TallyPrime (adjustment or contra entry).
    
        Args:
            date: Voucher date YYYYMMDD.
            debit_ledger: Ledger to debit.
            credit_ledger: Ledger to credit.
            amount: Journal amount.
            narration: Optional description.
        """
        try:
            result = await client.create_journal_voucher(
                date=date, debit_ledger=debit_ledger,
                credit_ledger=credit_ledger, amount=amount, narration=narration,
            )
            if result["success"]:
                return f"Journal voucher created. Dr: {debit_ledger}, Cr: {credit_ledger}, Amount: {amount:.2f}, Date: {date}"
            return f"Failed: {result['message']}"
        except TallyError as e:
            return f"Error: {e}"
  • TallyClient.create_journal_voucher — async client method that builds XML via create_journal_voucher_xml(), sends it to TallyPrime, parses the response, and returns a dict with success/message.
    async def create_journal_voucher(self, **kwargs) -> dict:
        from .xml_builder import create_journal_voucher_xml
        return self._check_import_result(self._parse(await self.send_xml(create_journal_voucher_xml(**kwargs))))
  • create_journal_voucher_xml — builds the Tally XML string for a Journal voucher with debit/credit ledger entries, wrapped in a voucher import envelope.
    def create_journal_voucher_xml(
        date: str,
        debit_ledger: str,
        credit_ledger: str,
        amount: float,
        narration: str = "",
    ) -> str:
        voucher = f"""<VOUCHER ACTION="Create" VCHTYPE="Journal">
              <DATE>{date}</DATE>
              <VOUCHERTYPENAME>Journal</VOUCHERTYPENAME>
              <NARRATION>{narration}</NARRATION>
              <ALLLEDGERENTRIES.LIST>
                <LEDGERNAME>{debit_ledger}</LEDGERNAME>
                <ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>
                <AMOUNT>-{amount}</AMOUNT>
              </ALLLEDGERENTRIES.LIST>
              <ALLLEDGERENTRIES.LIST>
                <LEDGERNAME>{credit_ledger}</LEDGERNAME>
                <ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
                <AMOUNT>{amount}</AMOUNT>
              </ALLLEDGERENTRIES.LIST>
            </VOUCHER>"""
        return _voucher_import_envelope(voucher)
  • register_all calls vouchers.register(mcp, client) which registers the create_journal_voucher tool onto the FastMCP instance via decorator pattern.
    def register_all(mcp: FastMCP, client: TallyClient):
        company.register(mcp, client)
        ledgers.register(mcp, client)
        vouchers.register(mcp, client)
        reports.register(mcp, client)
Behavior2/5

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

No annotations provided, and the description lacks behavioral details such as side effects, required permissions, or response format. It merely states the action without disclosing what happens or what the output contains, despite an output schema being present.

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?

The description is short and front-loaded, conveying purpose and parameter details in two compact sections. Every sentence adds value, though the Args section could be formatted more clearly as a list.

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?

For a simple create operation with an output schema, the description covers parameter usage but omits the output structure. It is adequate but leaves the agent guessing about the return value or error handling.

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?

With 0% schema description coverage, the description compensates by specifying date format (YYYYMMDD), ledger roles (debit/credit), amount as a number, and narration as optional. This adds meaningful context beyond the schema's property titles.

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 description clearly states the tool creates a journal voucher in TallyPrime, specifying it's for adjustment or contra entries. This distinguishes it from sales, payment, or purchase vouchers, though it doesn't explicitly name alternatives.

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 on when to use this tool versus siblings like create_payment_voucher or create_purchase_voucher. The description does not mention prerequisites, scenarios, or exclusions.

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