Skip to main content
Glama
PK-SANGAMESWAR

Expense Tracker MCP Server

edit_expense

Update existing expense records in the Expense Tracker database to correct errors, modify categories, adjust amounts, or add notes.

Instructions

Edit an existing expense in the database.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
dateYes
amountYes
categoryYes
subcategoryNo
noteNo

Implementation Reference

  • main.py:116-131 (handler)
    The edit_expense tool is defined and registered using the @mcp.tool() decorator, and contains the logic to update an existing expense entry in the SQLite database.
    @mcp.tool()
    def edit_expense(id, date, amount, category, subcategory="", note=""):
        """Edit an existing expense in the database."""
        try:
            with sqlite3.connect(DB_PATH) as conn:
                cursor = conn.cursor()
                cursor.execute("""
                UPDATE expenses
                SET date = ?, amount = ?, category = ?, subcategory = ?, note = ?
                WHERE id = ?
                """, (date, float(amount), category, subcategory, note, id))
                if cursor.rowcount == 0:
                    return {"status": "error", "error": "No expense with that id"}
                return {"status": "ok"}
        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 the full burden of behavioral disclosure. It states the tool edits an expense, implying a mutation operation, but lacks details on permissions needed, whether changes are reversible, error handling, or any rate limits. It doesn't describe what happens to unspecified fields or the response format, leaving significant gaps for a mutation tool.

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, efficient sentence with zero waste, front-loading the core action. It's appropriately sized for a simple tool, though its brevity contributes to gaps in other dimensions. Every word earns its place by clearly stating the tool's function.

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 tool's complexity (mutation with 6 parameters), lack of annotations, 0% schema coverage, and no output schema, the description is incomplete. It doesn't explain parameters, behavioral traits, or return values, making it insufficient for an AI agent to use the tool effectively without additional context or trial-and-error.

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 the description must compensate for undocumented parameters. It adds no meaning beyond the schema, failing to explain what 'id', 'date', 'amount', 'category', 'subcategory', or 'note' represent, their formats, or constraints. With 6 parameters and no schema descriptions, this is inadequate, scoring below the baseline of 3.

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 ('Edit') and resource ('an existing expense in the database'), making the purpose immediately understandable. It distinguishes from siblings like 'add_expense' (creation) and 'delete_expense' (removal), though it doesn't explicitly mention these distinctions. The description avoids tautology by not just restating the tool name.

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 doesn't mention prerequisites (e.g., needing an existing expense ID), exclusions (e.g., when to use 'add_expense' instead), or contextual cues for selection among siblings like 'edit_expense' vs. 'delete_expense'. Usage is implied but not explicitly stated.

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