get_current_user
Retrieve the current user's details to identify and manage their Carbon Voice account information, enabling personalized interaction and access to voice memos and conversations.
Instructions
Get the current user information.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- src/server.ts:388-408 (registration)Registers the 'get_current_user' MCP tool. The inline handler fetches the current user's information by calling the cvApi.getWhoAmI endpoint using the authentication token from the context. The input schema is empty as no parameters are required.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:398-407 (handler)The execution logic (handler) for the get_current_user tool. It extracts the auth token from the context, calls the underlying API's getWhoAmI method, formats the response, and handles errors.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-392 (schema)The input schema for the get_current_user tool, defined as an empty object since the tool requires no input parameters but needs access to authInfo context.{ description: 'Get the current user information. ', inputSchema: z.object({}).shape, // Needed in order to have access to authInfo