get_user_info
Retrieve user profile information from Money Lover personal finance app using authentication token to access account details.
Instructions
Retrieve the Money Lover user profile associated with the provided token.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | No | JWT token returned by the login tool or derived from EMAIL/PASSWORD environment variables |
Implementation Reference
- src/server.js:330-337 (handler)Handler function that resolves the authentication token if not provided, creates a MoneyloverClient instance, calls getUserInfo() on it, and returns a formatted success response or error.async ({ token }) => { try { const data = await runWithClient(token, client => client.getUserInfo()); return formatSuccess(data ?? {}); } catch (error) { return formatError(error instanceof Error ? error : new Error(String(error))); } }
- src/server.js:325-329 (schema)Schema definition for the get_user_info tool including title, description, and inputSchema which requires an optional token (referencing shared tokenArgument).{ title: 'Get User Info', description: 'Retrieve the Money Lover user profile associated with the provided token.', inputSchema: tokenArgument },
- src/server.js:323-338 (registration)Registration of the 'get_user_info' MCP tool using server.registerTool, specifying schema and handler function.server.registerTool( 'get_user_info', { title: 'Get User Info', description: 'Retrieve the Money Lover user profile associated with the provided token.', inputSchema: tokenArgument }, async ({ token }) => { try { const data = await runWithClient(token, client => client.getUserInfo()); return formatSuccess(data ?? {}); } catch (error) { return formatError(error instanceof Error ? error : new Error(String(error))); } } );
- src/moneyloverClient.js:118-120 (helper)Implementation of getUserInfo in MoneyloverClient class, which sends a POST request to the '/user/info' API endpoint using the private #post method.async getUserInfo() { return this.#post('/user/info'); }
- src/server.js:317-321 (schema)Shared input schema argument for token, used by get_user_info and other tools. tokenSchema is a Zod schema for optional string token.const tokenArgument = { token: tokenSchema.describe( 'JWT token returned by the login tool or derived from EMAIL/PASSWORD environment variables' ) };