search_for_users
Find LinkedIn users by applying filters such as school, company, or natural language queries to locate specific professional profiles.
Instructions
Search for users on Clado using filters like query, school, and match threshold.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Natural language search query to find LinkedIn profiles | |
| limit | No | Maximum number of profiles to return (1–100) | |
| schools | No | List of school names to filter results by, e.g., ['Stanford', 'MIT'] | |
| companies | No | List of company names to filter results by | |
| advanced_filtering | No | Enable AI agent-based filtering to improve result quality | |
| search_id | No | ID from previous search for pagination | |
| offset | No | Number of results to skip for pagination |
Implementation Reference
- src/tools/search-for-users.ts:31-79 (handler)Implementation of the search_for_users tool handler function that constructs a URL with parameters and makes an API request to Clado's search endpoint.
export const searchForUsersTool = async ({ query, limit = 30, schools, companies, advanced_filtering = true, search_id, offset = 0, }: SearchForUsersParams) => { const url = new URL("https://search.clado.ai/api/search"); url.searchParams.append("query", query); url.searchParams.append("limit", String(Math.min(limit, 100))); url.searchParams.append("advanced_filtering", String(advanced_filtering)); if (offset > 0) { url.searchParams.append("offset", String(offset)); } if (search_id) { url.searchParams.append("search_id", search_id); } if (schools && schools.length > 0) { schools.forEach((s: string) => url.searchParams.append("schools", s)); } if (companies && companies.length > 0) { companies.forEach((c: string) => url.searchParams.append("companies", c)); } const response = await makeCladoRequest(url.toString(), {}); const responseData = await response.json(); if (responseData.error) { throw new Error( `Failed to search for users: ${JSON.stringify(responseData.error)}` ); } return { content: [ { type: "text" as const, text: `Search completed successfully: ${JSON.stringify(responseData, null, 2)}` } ] }; }; - src/tools/search-for-users.ts:8-19 (schema)Zod schema defining the input parameters for the search_for_users tool.
export const searchForUsersSchema = { query: z.string().describe("Natural language search query to find LinkedIn profiles"), limit: z.number().min(1).max(100).default(30).describe("Maximum number of profiles to return (1–100)"), schools: z.array(z.string()).optional().describe("List of school names to filter results by, e.g., ['Stanford', 'MIT']"), companies: z.array(z.string()).optional().describe("List of company names to filter results by"), advanced_filtering: z .boolean() .default(true) .describe("Enable AI agent-based filtering to improve result quality"), search_id: z.string().uuid().optional().describe("ID from previous search for pagination"), offset: z.number().min(0).default(0).optional().describe("Number of results to skip for pagination"), }; - src/index.ts:24-28 (registration)Registration of the search_for_users tool on the MCP server in the main entry point.
server.tool( searchForUsersName, searchForUsersDescription, searchForUsersSchema, searchForUsersTool - src/server_setup.ts:11-14 (registration)Registration of the search_for_users tool on the MCP server in the setup function.
searchForUsersName, searchForUsersDescription, searchForUsersSchema, searchForUsersTool - src/tools/search-for-users.ts:4-6 (schema)Name and description exports used for tool registration.
export const searchForUsersName = "search_for_users"; export const searchForUsersDescription = "Search for users on Clado using filters like query, school, and match threshold.";