Skip to main content
Glama
Sudhanvaha

Expense Tracker MCP Server

by Sudhanvaha

add_expense

Add new expenses to your personal expense tracker by specifying date, amount, and category. This tool helps you record spending details with optional subcategory and note fields for better financial management.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes
amountYes
categoryYes
subcategoryNo
noteNo

Implementation Reference

  • main.py:39-46 (handler)
    The implementation of the 'add_expense' tool. This function is decorated with @mcp.tool(), which registers it as an MCP tool and defines its handler logic. It inserts a new expense record into the SQLite database table 'expenses' and returns the status and generated ID.
    @mcp.tool() def add_expense(date, amount, category, subcategory="", note=""): with sqlite3.connect(DB_PATH) as c: cur = c.execute( "INSERT INTO expenses(date, amount, category, subcategory, note) VALUES (?, ?, ?, ?, ?)", (date, amount, category, subcategory, note) ) return {"status": "ok", "id": cur.lastrowid}

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/Sudhanvaha/expense-tracker-mcp-server'

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