search_for_users
Find LinkedIn users by search query with filters for school names and match score thresholds to identify relevant professional connections.
Instructions
Search for users on Linkd using filters like query, school, and match threshold.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The search query, e.g., 'People working on AI at FAANG' | |
| limit | No | Maximum number of results to return (1–30) | |
| school | No | Filter by school name(s), e.g., ['Stanford', 'MIT'] | |
| acceptance_threshold | No | Match score threshold between 0 and 100 |
Implementation Reference
- src/tools/search-for-users.ts:27-60 (handler)The async handler function `searchForUsersTool` that implements the core logic: builds search URL with params, calls Linkd API via `makeLinkdRequest`, handles errors, and formats response as MCP content.export const searchForUsersTool = async ({ query, limit = 10, school, acceptance_threshold = 60, }: SearchForUsersParams) => { const url = new URL("https://search.linkd.inc/api/search/users"); url.searchParams.append("query", query); url.searchParams.append("limit", String(Math.min(limit, 30))); url.searchParams.append("acceptance_threshold", String(Math.max(0, Math.min(100, acceptance_threshold)))); if (school && school.length > 0) { school.forEach((s: string) => url.searchParams.append("school", s)); } const response = await makeLinkdRequest(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 succesfully: ${JSON.stringify(responseData, null, 2)}` } ] }; };
- src/tools/search-for-users.ts:8-18 (schema)Zod schema defining input parameters for the tool: query (string), limit (number 1-30), optional school array, acceptance_threshold (0-100).export const searchForUsersSchema = { query: z.string().describe("The search query, e.g., 'People working on AI at FAANG'"), limit: z.number().min(1).max(30).default(10).describe("Maximum number of results to return (1–30)"), school: z.array(z.string()).optional().describe("Filter by school name(s), e.g., ['Stanford', 'MIT']"), acceptance_threshold: z .number() .min(0) .max(100) .default(60) .describe("Match score threshold between 0 and 100"), };
- src/server_setup.ts:13-18 (registration)Registers the tool on the MCP server by calling `server.tool` with name, description, schema, and handler function.searchForUsersName, searchForUsersDescription, searchForUsersSchema, searchForUsersTool );