Skip to main content
Glama
SannketNikam

Demo MCP Server

by SannketNikam

summarize

Summarize expenses by category within a specified date range to analyze spending patterns and track financial data.

Instructions

Summarize expenses by category within an inclusive date range.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateYes
end_dateYes
categoryNo

Implementation Reference

  • main.py:78-99 (handler)
    The main handler function for the 'summarize' MCP tool. It queries the SQLite database for expenses between start_date and end_date, optionally filtered by category, groups by category, computes total amount and count per category, and returns the results as a list of dictionaries.
    async def summarize(start_date, end_date, category=None):  # Changed: added async
        '''Summarize expenses by category within an inclusive date range.'''
        try:
            async with aiosqlite.connect(DB_PATH) as c:  # Changed: added async
                query = """
                    SELECT category, SUM(amount) AS total_amount, COUNT(*) as count
                    FROM expenses
                    WHERE date BETWEEN ? AND ?
                """
                params = [start_date, end_date]
    
                if category:
                    query += " AND category = ?"
                    params.append(category)
    
                query += " GROUP BY category ORDER BY total_amount DESC"
    
                cur = await c.execute(query, params)  # Changed: added await
                cols = [d[0] for d in cur.description]
                return [dict(zip(cols, r)) for r in await cur.fetchall()]  # Changed: added await
        except Exception as e:
            return {"status": "error", "message": f"Error summarizing expenses: {str(e)}"}
  • main.py:77-77 (registration)
    The @mcp.tool() decorator registers the subsequent 'summarize' function as an MCP tool with FastMCP.
    @mcp.tool()
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 of behavioral disclosure. It states the tool summarizes expenses but doesn't describe how (e.g., aggregation method, output format), whether it's read-only or has side effects, or any constraints like rate limits or authentication needs. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 key details (summarize, expenses, category, date range) without redundancy. 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 (summarization with 3 parameters), lack of annotations, 0% schema description coverage, and no output schema, the description is incomplete. It doesn't explain the summarization output, parameter details, or behavioral traits, leaving the agent with insufficient context to use the tool effectively.

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?

The input schema has 0% description coverage, so parameters are undocumented. The description mentions 'category' and 'inclusive date range', which hints at the 'category', 'start_date', and 'end_date' parameters, but doesn't explain their semantics (e.g., date format, category values, whether category is optional). It adds minimal value beyond the schema's property names.

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 an inclusive date range.' It specifies the verb ('summarize'), resource ('expenses'), and scope ('by category', 'within an inclusive date range'). However, it doesn't explicitly differentiate from sibling tools like 'list_expenses' (which might list individual expenses rather than summarize them).

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 'add_expense' or 'list_expenses', nor does it specify prerequisites, exclusions, or appropriate contexts for summarization versus listing. The agent must infer usage 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/SannketNikam/test-remote-mcp-server'

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