search_user
Find users on the Carbon Voice server by entering their phone number, email address, ID, or name. When using a name, results are limited to users in your contacts list.
Instructions
Search for a User by their phone number, email address, id or name. (In order to search for a User, you must provide a phone number, email address, id or name.)When searching by name, only users that are part of your contacts will be returned
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| No | Email Address | ||
| name | No | The name of the user to search for (Only users that are part of your contacts will be returned) | |
| phone | No | Phone Number |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"email": {
"description": "Email Address",
"type": "string"
},
"name": {
"description": "The name of the user to search for (Only users that are part of your contacts will be returned)",
"type": "string"
},
"phone": {
"description": "Phone Number",
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- src/server.ts:332-358 (registration)MCP server tool registration for 'search_user', including input schema, description, annotations, and the handler function that delegates to the generated simplifiedApi.searchUser with authentication header and formats the response using formatToMCPToolResponse.server.registerTool( 'search_user', { description: 'Search for a User by their phone number, email address, id or name. ' + '(In order to search for a User, you must provide a phone number, email address, id or name.)' + 'When searching by name, only users that are part of your contacts will be returned', inputSchema: searchUserQueryParams.shape, annotations: { readOnlyHint: true, destructiveHint: false, }, }, async (args: SearchUserParams, { authInfo }): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.searchUser( args, setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error searching for user:', { args, error }); return formatToMCPToolResponse(error); } }, );
- Zod input schema definition (searchUserQueryParams) for the 'search_user' tool, defining optional email, phone, or name parameters.export const searchUserQueryParams = zod.object({ "email": zod.string().optional().describe('Email Address'), "phone": zod.string().optional().describe('Phone Number'), "name": zod.string().optional().describe('The name of the user to search for (Only users that are part of your contacts will be returned)') })
- TypeScript type definition for SearchUserParams, matching the Zod schema used in the tool.export type SearchUserParams = { /** * Email Address */ email?: string; /** * Phone Number */ phone?: string; /** * The name of the user to search for (Only users that are part of your contacts will be returned) */ name?: string; };
- Generated API client helper function 'searchUser' that performs the HTTP GET request to `/simplified/users/search` with query params to fetch user data.const searchUser = ( params?: SearchUserParams, options?: SecondParameter<typeof mutator>, ) => { return mutator<User>( { url: `/simplified/users/search`, method: 'GET', params }, options, ); };