search_for_companies
Find companies on LinkedIn using search queries and filters like match thresholds to identify relevant business entities for research or networking purposes.
Instructions
Search for companies on Linkd using filters like query and match threshold.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The search query, e.g., 'Tech companies in California' | |
| limit | No | Maximum number of results to return (1–30) | |
| acceptance_threshold | No | Match score threshold between 0 and 100 |
Implementation Reference
- src/tools/search-for-companies.ts:25-52 (handler)The main handler function for the 'search_for_companies' tool. It constructs a search URL with query, limit, and threshold parameters, makes a request to the Linkd API using makeLinkdRequest, handles errors, and returns the response in MCP content format.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 the input parameters for the tool: query (required string), limit (optional number 1-30, default 10), acceptance_threshold (optional 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 the name, description, schema, and handler function.server.tool( searchForCompaniesName, searchForCompaniesDescription, searchForCompaniesSchema, searchForCompaniesTool );