get_all_expenses
Retrieve all recorded expenses from the Expense Tracker MCP Server to view spending history and manage financial records.
Instructions
Get all expenses
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:70-70 (registration)Registers the get_all_expenses tool using the @mcp.tool decorator in FastMCP.@mcp.tool
- main.py:71-76 (handler)The main handler function for the get_all_expenses tool. It initializes the database if needed, queries all expenses from the SQLite database ordered by date descending, and returns them as a list of dictionaries.async def get_all_expenses() -> List[Dict]: """Get all expenses""" await init_db() cursor = conn.cursor() cursor.execute('SELECT * FROM expenses ORDER BY date DESC') return [dict(row) for row in cursor.fetchall()]