Skip to main content
Glama

get_user

Retrieve user information from Carbon Voice by providing a user ID to access conversation data and contact details.

Instructions

Get a User by their ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • Registration and inline handler function for the 'get_user' MCP tool. It takes a user ID, authenticates with a token, calls the Carbon Voice API's getUserById, and formats the response as McpToolResponse.
    server.registerTool( 'get_user', { description: 'Get a User by their ID.', inputSchema: getUserByIdParams.shape, annotations: { readOnlyHint: true, destructiveHint: false, }, }, async (args: GetByIdParams, { authInfo }): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.getUserById( args.id, setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error getting user by id:', { args, error }); return formatToMCPToolResponse(error); } }, );
  • Zod input schema for getUserByIdParams used by the 'get_user' tool, requiring a string 'id'.
    export const getUserByIdParams = zod.object({ "id": zod.string() })
  • Generated API client method getUserById that performs the HTTP GET request to retrieve user data by ID from the Carbon Voice API.
    const getUserById = ( id: string, options?: SecondParameter<typeof mutator>, ) => { return mutator<User>( { url: `/simplified/users/${id}`, method: 'GET' }, options, ); };
  • Zod response schema defining the structure of the User object returned by getUserById.
    export const getUserByIdResponse = zod.object({ "id": zod.string().describe(' ID'), "link": zod.string().describe('Link to User'), "created_at": zod.string().datetime({}), "first_name": zod.string().describe('First Name'), "last_name": zod.string().optional().describe('Last Name'), "full_name": zod.string().describe('Full Name'), "image_url": zod.string().optional().describe('Image Url'), "emails": zod.array(zod.string()).optional().describe('List of emails (First one is the primary)'), "phones": zod.array(zod.string()).optional().describe('List of phones (First one is the primary)'), "languages": zod.array(zod.string()).optional().describe('List of languages (First one is the primary)') })

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/PhononX/cv-mcp-server'

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