list_expenses
Retrieve all recorded expenses between specified start and end dates to review spending history and track financial activity over time.
Instructions
list all expenses within an inclusive date range
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| start_date | Yes | ||
| end_date | Yes |
Implementation Reference
- main.py:48-60 (handler)The handler function for the list_expenses tool, registered via @mcp.tool(). It retrieves expenses from the SQLite database within the given date range and returns them as a list of dictionaries.@mcp.tool() def list_expenses(start_date, end_date): """list all expenses within an inclusive date range""" with sqlite3.connect(DB_PATH) as c: cur = c.execute( """SELECT * from expenses where date between ? and ? order by id asc""", (start_date, end_date) ) cols = [d[0] for d in cur.description] return [dict(zip(cols, r)) for r in cur.fetchall()]