Skip to main content
Glama
PK-SANGAMESWAR

Expense Tracker MCP Server

list_expenses

Retrieve expense records from the database within a specified date range to review spending history and track financial activity.

Instructions

List all expenses in the database between start_date and end_date (inclusive).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateYes
end_dateYes

Implementation Reference

  • main.py:71-84 (handler)
    The `list_expenses` tool is registered using the `@mcp.tool()` decorator and implemented as a function that queries the SQLite database for records between `start_date` and `end_date`.
    @mcp.tool()
    def list_expenses(start_date, end_date):
        """List all expenses in the database between start_date and end_date (inclusive)."""
        try:
            with sqlite3.connect(DB_PATH) as conn:
                cursor = conn.cursor()
                cursor.execute(
                    "SELECT id, date, amount, category, subcategory, note FROM expenses WHERE date BETWEEN ? AND ? ORDER BY id ASC",
                    (start_date, end_date)
                )
                cols = [desc[0] for desc in cursor.description]
                return {"status": "ok", "expenses": [dict(zip(cols, row)) for row in cursor.fetchall()]}
        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?

No annotations are provided, so the description carries the full burden. It states the tool lists expenses, implying a read-only operation, but doesn't disclose behavioral traits such as whether it requires authentication, has rate limits, returns paginated results, or handles errors. This leaves significant gaps for an AI agent.

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. It's front-loaded with the core purpose and includes essential details about the date range. Every word earns its place, making it highly concise and well-structured.

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 (a read operation with date filtering), lack of annotations, and no output schema, the description is incomplete. It doesn't cover return values, error handling, or behavioral aspects like pagination. For a tool with 2 parameters and no structured support, more context is needed.

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

Parameters3/5

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

The description adds meaning by specifying that the parameters define a date range ('between start_date and end_date (inclusive)'), which clarifies their purpose beyond the schema's generic titles. However, with 0% schema description coverage and 2 parameters, it doesn't detail format (e.g., YYYY-MM-DD) or constraints, so it only partially compensates.

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's purpose: 'List all expenses in the database between start_date and end_date (inclusive).' It specifies the verb ('List'), resource ('expenses'), and scope ('between start_date and end_date'). However, it doesn't explicitly differentiate from sibling tools like 'summarize' or 'add_expense', which keeps it from a perfect score.

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 sibling tools like 'summarize' for aggregated data or 'add_expense' for creating entries, nor does it specify prerequisites or exclusions. The usage context is implied but not explicit.

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