Skip to main content
Glama
naveen6768

Expense Tracker MCP

by naveen6768

delete_expense

Remove an expense record from your expense tracker by providing its unique ID.

Instructions

Delete an expense by its id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expense_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
deletedYes
expense_idYes
remaining_expense_countYes

Implementation Reference

  • main.py:40-43 (schema)
    Pydantic model defining the return schema for delete_expense (deleted bool, expense_id str, remaining_expense_count int).
    class DeleteExpenseResult(BaseModel):
        deleted: bool
        expense_id: str
        remaining_expense_count: int
  • main.py:257-272 (handler)
    The delete_expense tool handler: normalizes the expense_id, loads all expenses, filters out the matching expense, saves the remaining list, and returns a DeleteExpenseResult.
    @mcp.tool
    def delete_expense(expense_id: str) -> DeleteExpenseResult:
        """Delete an expense by its id."""
        normalized_id = _normalize_text(expense_id, "expense_id")
        expenses = _load_expenses()
    
        remaining = [expense for expense in expenses if expense.id != normalized_id]
        if len(remaining) == len(expenses):
            raise ValueError(f"No expense found with id {normalized_id}.")
    
        _save_expenses(remaining)
        return DeleteExpenseResult(
            deleted=True,
            expense_id=normalized_id,
            remaining_expense_count=len(remaining),
        )
  • main.py:257-258 (registration)
    The delete_expense function is registered as an MCP tool via the @mcp.tool decorator on line 257.
    @mcp.tool
    def delete_expense(expense_id: str) -> DeleteExpenseResult:
Behavior2/5

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

No annotations are provided, so the description must carry the full burden. It indicates deletion (destructive) but does not disclose side effects, permissions needed, reversibility, or consequences for associated data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that front-loads the action. It is efficient but could be slightly more structured without becoming verbose.

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?

For a simple id-based deletion tool with an output schema, the description is adequate but incomplete. It lacks prerequisites, error conditions, and output expectations. With no annotations, more context would be beneficial.

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. It mentions 'by its id' but does not explain the expense_id parameter's format, origin, or constraints beyond what the schema states (string).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (delete) and resource (expense) and specifies the identifier (by its id). It distinguishes from sibling tools: add_expense creates, get_expense_summary summarizes, list_expenses lists.

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?

No explicit guidance on when to use this tool versus alternatives. The description only implies use when an expense id is available but does not provide context like prerequisites or when not to use.

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/naveen6768/MCP'

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