Skip to main content
Glama
PK-SANGAMESWAR

Expense Tracker MCP Server

summarize

Summarize expenses by category within a specified date range to analyze spending patterns and track financial data from the Expense Tracker MCP Server.

Instructions

Summarize expenses by category within the inclusive date range. Returns list of {"category": ..., "total": ...} ordered by total descending.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateYes
end_dateYes
categoryNo

Implementation Reference

  • main.py:88-110 (handler)
    The implementation of the 'summarize' MCP tool which queries a SQLite database to aggregate expenses by category.
    @mcp.tool()
    def summarize(start_date, end_date, category=None):
        """
        Summarize expenses by category within the inclusive date range.
        Returns list of {"category": ..., "total": ...} ordered by total descending.
        """
        try:
            with sqlite3.connect(DB_PATH) as conn:
                params = [start_date, end_date]
                query = """
                    SELECT category, SUM(amount) as total
                    FROM expenses
                    WHERE date BETWEEN ? AND ?
                """
                if category:
                    query += " AND category = ?"
                    params.append(category)
    
                query += " GROUP BY category ORDER BY total DESC"
                cursor = conn.cursor()
                cursor.execute(query, params)
                cols = [desc[0] for desc in cursor.description]
                return {"status": "ok", "summary": [dict(zip(cols, row)) for row in cursor.fetchall()]}
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 mentions the return format ('list of {...} ordered by total descending'), which adds some behavioral context, but lacks details on permissions, error handling, data sources, or side effects. For a tool with no annotations, this is minimal disclosure.

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 highly concise and front-loaded: two sentences with zero waste. The first sentence states the purpose, and the second explains the return format, both earning their place efficiently.

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?

Given no annotations, 0% schema coverage, and no output schema, the description is moderately complete. It covers purpose and return format but lacks details on parameters, error cases, or integration with siblings. For a tool with three parameters and no structured support, it should do more to be fully helpful.

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?

Schema description coverage is 0%, so the description must compensate. It implies date-range parameters ('within the inclusive date range') and category filtering ('by category'), mapping to the three parameters. However, it doesn't specify formats (e.g., date strings) or clarify the optional 'category' parameter's role, leaving gaps in parameter understanding.

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: 'Summarize expenses by category within the inclusive date range.' It specifies the verb ('summarize'), resource ('expenses'), and scope ('by category within date range'). However, it doesn't explicitly differentiate from sibling tools like 'list_expenses' which might also handle date ranges.

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 'list_expenses' for detailed listings or 'add_expense' for adding data, leaving the agent to infer usage context from the purpose alone.

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