search_for_companies
Find companies on LinkedIn by applying specific search queries and match score thresholds. Filter results with a custom limit for precise, targeted data retrieval.
Instructions
Search for companies on Linkd using filters like query and match threshold.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| acceptance_threshold | No | Match score threshold between 0 and 100 | |
| limit | No | Maximum number of results to return (1–30) | |
| query | Yes | The search query, e.g., 'Tech companies in California' |
Implementation Reference
- src/tools/search-for-companies.ts:25-52 (handler)The main handler function `searchForCompaniesTool` that constructs the API URL, makes a request to search for companies using `makeLinkdRequest`, handles errors, and returns the response as text content.export const searchForCompaniesTool = async ({ query, limit = 10, acceptance_threshold = 60, }: SearchForCompaniesParams) => { const url = new URL("https://search.linkd.inc/api/search/companies"); 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)))); const response = await makeLinkdRequest(url.toString(), {}); const responseData = await response.json(); if (responseData.error) { throw new Error( `Failed to search for companies: ${JSON.stringify(responseData.error)}` ); } return { content: [ { type: "text" as const, text: `search completed successfully: ${JSON.stringify(responseData, null, 2)}` } ] }; };
- Zod schema defining input parameters: query (string), limit (number 1-30 default 10), acceptance_threshold (number 0-100 default 60).export const searchForCompaniesSchema = { query: z.string().describe("The search query, e.g., 'Tech companies in California'"), limit: z.number().min(1).max(30).default(10).describe("Maximum number of results to return (1–30)"), acceptance_threshold: z .number() .min(0) .max(100) .default(60) .describe("Match score threshold between 0 and 100"), };
- src/server_setup.ts:19-24 (registration)Registers the `search_for_companies` tool on the MCP server by calling `server.tool` with name, description, schema, and handler.server.tool( searchForCompaniesName, searchForCompaniesDescription, searchForCompaniesSchema, searchForCompaniesTool );