Skip to main content
Glama
akutishevsky

LunchMoney MCP Server

get_user

Retrieve current user account details from LunchMoney to access personal finance information and manage financial data.

Instructions

Get details on the current user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The inline async handler function for the 'get_user' MCP tool. It fetches the current user's profile from the Lunchmoney API endpoint '/me' using the configured API token and returns the User object as a JSON string in the tool response content.
    server.tool("get_user", "Get details on the current user", {}, async () => { const { baseUrl, lunchmoneyApiToken } = getConfig(); const response = await fetch(`${baseUrl}/me`, { headers: { Authorization: `Bearer ${lunchmoneyApiToken}`, }, }); if (!response.ok) { return { content: [ { type: "text", text: `Failed to get user details: ${response.statusText}`, }, ], }; } const user: User = await response.json(); return { content: [ { type: "text", text: JSON.stringify(user), }, ], }; }); }
  • TypeScript interface defining the structure of the User object, which is fetched and returned by the get_user tool handler.
    export interface User { user_id: number; user_name: string; user_email: string; account_id: number; budget_name: string; primary_currency: string; api_key_label: string | null; }
  • src/tools/user.ts:5-36 (registration)
    The registerUserTools function that registers the 'get_user' tool on the MCP server instance.
    export function registerUserTools(server: McpServer) { server.tool("get_user", "Get details on the current user", {}, async () => { const { baseUrl, lunchmoneyApiToken } = getConfig(); const response = await fetch(`${baseUrl}/me`, { headers: { Authorization: `Bearer ${lunchmoneyApiToken}`, }, }); if (!response.ok) { return { content: [ { type: "text", text: `Failed to get user details: ${response.statusText}`, }, ], }; } const user: User = await response.json(); return { content: [ { type: "text", text: JSON.stringify(user), }, ], }; }); }
  • src/index.ts:23-23 (registration)
    Invocation of registerUserTools in the main server setup to register the get_user tool.
    registerUserTools(server);

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/akutishevsky/lunchmoney-mcp'

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