get_user
Retrieve personal finance account details and user profile information for the authenticated user.
Instructions
Get details on the current user
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/user.ts:14-28 (handler)Async handler that calls GET /me to fetch current user details, returns the User object via dataResponse.
async () => { try { const response = await api.get("/me"); if (!response.ok) { return handleApiError(response, "Failed to get user"); } const user: User = await response.json(); return dataResponse(user); } catch (error) { return catchError(error, "Failed to get user"); } }, - src/types.ts:1-9 (schema)User interface defining the shape of the user object returned by the get_user tool.
export interface User { id: number; name: string; email: string; account_id: number; budget_name: string; primary_currency: string; api_key_label: string | null; } - src/tools/user.ts:5-29 (registration)registerUserTools function that registers the get_user tool on the McpServer with description and readOnlyHint annotation.
export function registerUserTools(server: McpServer) { server.registerTool( "get_user", { description: "Get details on the current user", annotations: { readOnlyHint: true, }, }, async () => { try { const response = await api.get("/me"); if (!response.ok) { return handleApiError(response, "Failed to get user"); } const user: User = await response.json(); return dataResponse(user); } catch (error) { return catchError(error, "Failed to get user"); } }, ); - src/index.ts:25-25 (registration)Call to registerUserTools(server) in the main entry point to wire up the get_user tool.
registerUserTools(server); - src/api.ts:168-172 (helper)dataResponse helper used by the get_user handler to format the User object as a text response.
export function dataResponse(data: unknown) { return { content: [{ type: "text" as const, text: formatData(data) }], }; }