Skip to main content
Glama

get_user

Retrieve a specific user's complete profile by ID, including roles, permissions, and billing rates from Harvest time tracking.

Instructions

Retrieve a specific user by ID. Returns complete user profile including roles, permissions, and billing rates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYesThe ID of the user to retrieve

Implementation Reference

  • The GetUserHandler class defines the execution logic for the 'get_user' tool.
    class GetUserHandler implements ToolHandler {
      constructor(private readonly config: BaseToolConfig) {}
    
      async execute(args: Record<string, any>): Promise<CallToolResult> {
        try {
          const inputSchema = z.object({ user_id: z.number().int().positive() });
          const { user_id } = validateInput(inputSchema, args, 'get user');
          
          logger.info('Fetching user from Harvest API', { userId: user_id });
          const user = await this.config.harvestClient.getUser(user_id);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(user, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'get_user');
        }
      }
    }
  • The registration entry for the 'get_user' tool, which binds the 'get_user' name to the GetUserHandler instance.
    {
      tool: {
        name: 'get_user',
        description: 'Retrieve a specific user by ID. Returns complete user profile including roles, permissions, and billing rates.',
        inputSchema: {
          type: 'object',
          properties: {
            user_id: { type: 'number', description: 'The ID of the user to retrieve' },
          },
          required: ['user_id'],
          additionalProperties: false,
        },
      },
      handler: new GetUserHandler(config),
    },

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/ianaleck/harvest-mcp-server'

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