get_current_user
Retrieve your current user profile details from the Carbon Voice platform to access account information and manage conversations.
Instructions
Get the current user information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:398-407 (handler)The inline handler function for the 'get_current_user' tool. It calls the CarbonVoice API's getWhoAmI method with the authentication token to retrieve the current user's information and formats the response using formatToMCPToolResponse.async (params: unknown, { authInfo }): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await cvApi.getWhoAmI(setCarbonVoiceAuthHeader(authInfo?.token)), ); } catch (error) { logger.error('Error searching users:', { params, error }); return formatToMCPToolResponse(error); } },
- src/server.ts:388-408 (registration)The registration of the 'get_current_user' tool on the MCP server, including the tool name, description, input schema (empty object), annotations, and the inline handler function.server.registerTool( 'get_current_user', { description: 'Get the current user information. ', inputSchema: z.object({}).shape, // Needed in order to have access to authInfo annotations: { readOnlyHint: true, destructiveHint: false, }, }, async (params: unknown, { authInfo }): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await cvApi.getWhoAmI(setCarbonVoiceAuthHeader(authInfo?.token)), ); } catch (error) { logger.error('Error searching users:', { params, error }); return formatToMCPToolResponse(error); } }, );
- src/server.ts:390-397 (schema)Input schema and metadata for the 'get_current_user' tool: empty input schema (z.object({})), description, and read-only annotation.{ description: 'Get the current user information. ', inputSchema: z.object({}).shape, // Needed in order to have access to authInfo annotations: { readOnlyHint: true, destructiveHint: false, }, },