Skip to main content
Glama
PK-SANGAMESWAR

Expense Tracker MCP Server

add_expense

Add a new expense to the Expense Tracker MCP Server database by specifying date, amount, category, and optional details to record financial transactions.

Instructions

Add a new expense to the database.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes
amountYes
categoryYes
subcategoryNo
noteNo

Implementation Reference

  • main.py:55-67 (handler)
    The add_expense tool is defined with the @mcp.tool() decorator and uses sqlite3 to insert new entries into the expenses table.
    @mcp.tool()
    def add_expense(date, amount, category, subcategory="", note=""):
        """Add a new expense to the database."""
        try:
            with sqlite3.connect(DB_PATH) as conn:
                cursor = conn.cursor()
                cursor.execute("""
                INSERT INTO expenses (date, amount, category, subcategory, note)
                VALUES (?, ?, ?, ?, ?)
                """, (date, float(amount), category, subcategory, note))
                return {"status": "ok", "id": cursor.lastrowid}
        except Exception as e:
            return {"status": "error", "error": str(e)}
Behavior2/5

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

With no annotations provided, the description carries full burden but only states it adds an expense without disclosing behavioral traits like permissions needed, whether it's idempotent, error handling, or what happens on success/failure. It's a basic statement that doesn't compensate for the lack of annotations.

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 a single, clear sentence with zero wasted words. It's front-loaded and appropriately sized for the tool's function, making it highly efficient.

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

Completeness2/5

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

Given the complexity (a mutation tool with 5 parameters), no annotations, no output schema, and 0% schema coverage, the description is incomplete. It doesn't address return values, error cases, or provide enough context for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so parameters are undocumented in the schema. The description adds no meaning beyond the schema—it doesn't explain what 'date', 'amount', or 'category' represent, their formats, or constraints. This fails to compensate for the low coverage.

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 action ('Add') and resource ('a new expense to the database'), making the purpose immediately understandable. It doesn't distinguish from siblings like 'add_credit' or 'edit_expense', but it's not vague or tautological.

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 like 'edit_expense' or 'add_credit'. It doesn't mention prerequisites, exclusions, or specific contexts, leaving usage entirely implicit.

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/PK-SANGAMESWAR/mcp-expense-tracker'

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