get_user
Retrieve authenticated user details including user ID from the YNAB financial management system.
Instructions
[1 API call] Get the authenticated user's information including user ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/user.ts:6-18 (handler)The 'get_user' tool implementation, including its registration and the asynchronous handler that fetches user data using the YNAB client.
server.registerTool("get_user", { title: "Get User", description: "[1 API call] Get the authenticated user's information including user ID", annotations: { readOnlyHint: true }, }, async () => { try { const response = await getClient().user.getUser(); const user = response.data.user; return textResult(`User ID: ${user.id}`); } catch (e: any) { return errorResult(e.message); } }); - src/tools/user.ts:5-19 (registration)The registerUserTools function that registers the 'get_user' tool with the McpServer.
export function registerUserTools(server: McpServer) { server.registerTool("get_user", { title: "Get User", description: "[1 API call] Get the authenticated user's information including user ID", annotations: { readOnlyHint: true }, }, async () => { try { const response = await getClient().user.getUser(); const user = response.data.user; return textResult(`User ID: ${user.id}`); } catch (e: any) { return errorResult(e.message); } }); }