get_total
Calculate total expenses from the Expense Tracker MCP Server to monitor spending and track financial overview.
Instructions
Get total of all expenses
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:60-67 (handler)The @mcp.tool decorator registers the get_total function as a tool. This async handler computes and returns the total sum of all expense amounts from the SQLite database.@mcp.tool async def get_total() -> float: """Get total of all expenses""" await init_db() cursor = conn.cursor() cursor.execute('SELECT SUM(amount) as total FROM expenses') result = cursor.fetchone() return result['total'] or 0.0