Skip to main content
Glama
abutbul

Gatherings MCP Server

by abutbul

add_expense

Track expenses for social events by adding payments made by members. Input gathering ID, member name, and amount to manage reimbursements and settle balances effectively.

Instructions

Add an expense for a member

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesAmount paid by the member
gathering_idYesID of the gathering
member_nameYesName of the member who paid

Implementation Reference

  • src/index.ts:82-103 (registration)
    Registers the 'add_expense' MCP tool with name, description, and input schema in the listTools response.
    { name: 'add_expense', description: 'Add an expense for a member', inputSchema: { type: 'object', properties: { gathering_id: { type: 'string', description: 'ID of the gathering', }, member_name: { type: 'string', description: 'Name of the member who paid', }, amount: { type: 'number', description: 'Amount paid by the member', }, }, required: ['gathering_id', 'member_name', 'amount'], }, },
  • Executes the 'add_expense' tool by validating input arguments and constructing the CLI command to invoke the Python backend.
    case 'add_expense': if (!isExpenseArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid add_expense arguments'); } command += ` add-expense "${args.gathering_id}" "${args.member_name}" ${args.amount}`; break;
  • Type guard function used to validate the arguments for the 'add_expense' tool.
    const isExpenseArgs = (args: any): args is { gathering_id: string; member_name: string; amount: number } => typeof args === 'object' && args !== null && typeof args.gathering_id === 'string' && typeof args.member_name === 'string' && typeof args.amount === 'number';

Other Tools

Related 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/abutbul/gatherings-mcp'

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