Skip to main content
Glama
justmytwospence

ynab-mcp

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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);
        }
      });
    }

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/justmytwospence/ynab-mcp'

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