initiate_deep_research
Start comprehensive research by combining multiple search variations with optional contact enrichment to find LinkedIn profiles matching specific criteria.
Instructions
Initiate a deep research job that combines multiple search variations with optional email enrichment. Each result costs 1 credit.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The search query to research | |
| limit | No | Maximum number of results to return (default: 30, max: 100) | |
| school | No | Filter results by school names | |
| enrich_emails | No | Whether to enrich results with contact information (default: true) | |
| acceptance_threshold | No | Acceptance score threshold (0-100) for a match (default: 60) |
Implementation Reference
- The async handler function that executes the tool logic: constructs a request to the deep research API endpoint, handles parameters with defaults and bounds checking, makes the POST request using makeLinkdRequest, parses response, throws error if failed, and returns formatted content.export const initiateDeepResearchTool = async ({ query, limit = 30, school, enrich_emails = true, acceptance_threshold = 60, }: InitiateDeepResearchParams) => { const apiUrl = new URL("https://search.linkd.inc/api/search/deep_research"); const body = { query, limit: Math.min(limit, 100), school, enrich_emails, acceptance_threshold: Math.max(0, Math.min(100, acceptance_threshold)), }; const response = await makeLinkdRequest(apiUrl.toString(), { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify(body), }); const responseData = await response.json(); if (responseData.error) { throw new Error( `Failed to initiate deep research: ${JSON.stringify(responseData.error)}` ); } return { content: [ { type: "text" as const, text: `deep research job initiated: ${JSON.stringify(responseData, null, 2)}` } ] }; };
- Zod schema defining the input parameters for the tool, including descriptions, defaults, and constraints.export const initiateDeepResearchSchema = { query: z.string().describe("The search query to research"), limit: z.number().max(100).default(30).describe("Maximum number of results to return (default: 30, max: 100)"), school: z.array(z.string()).optional().describe("Filter results by school names"), enrich_emails: z.boolean().default(true).describe("Whether to enrich results with contact information (default: true)"), acceptance_threshold: z.number().min(0).max(100).default(60).describe("Acceptance score threshold (0-100) for a match (default: 60)"), };
- src/server_setup.ts:47-52 (registration)Registration of the 'initiate_deep_research' tool with the MCP server using server.tool().server.tool( initiateDeepResearchName, initiateDeepResearchDescription, initiateDeepResearchSchema, initiateDeepResearchTool );