linkedin_search_exa
Search LinkedIn profiles, companies, and business content to support networking, recruitment, and research. Specify queries, search types, and result limits for targeted professional insights.
Instructions
Search LinkedIn profiles and companies using Exa AI - finds professional profiles, company pages, and business-related content on LinkedIn. Useful for networking, recruitment, and business research.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| numResults | No | Number of LinkedIn results to return (default: 5) | |
| query | Yes | LinkedIn search query (e.g., person name, company, job title) | |
| searchType | No | Type of LinkedIn content to search (default: all) |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"numResults": {
"description": "Number of LinkedIn results to return (default: 5)",
"type": "number"
},
"query": {
"description": "LinkedIn search query (e.g., person name, company, job title)",
"type": "string"
},
"searchType": {
"description": "Type of LinkedIn content to search (default: all)",
"enum": [
"profiles",
"companies",
"all"
],
"type": "string"
}
},
"required": [
"query"
],
"type": "object"
}
Implementation Reference
- src/tools/index.ts:239-248 (handler)MCP tool handler implementation for 'linkedin_search_exa'. Validates input schema, executes ExaClient.searchLinkedIn(), formats output with formatLinkedInResults, and returns structured response.case 'linkedin_search_exa': { const params = linkedInSearchSchema.parse(args); const results = await client.searchLinkedIn(params); return { content: [{ type: "text", text: formatLinkedInResults(results) }] }; }
- src/tools/index.ts:55-61 (schema)Zod input schema definition used for validating parameters in the linkedin_search_exa tool handler.const linkedInSearchSchema = z.object({ query: z.string().describe("Search query for LinkedIn profiles or companies"), search_type: z.enum(['people', 'companies', 'both']).optional().default('both').describe("Type of LinkedIn search"), num_results: z.number().optional().default(10).describe("Number of results to return"), include_bios: z.boolean().optional().default(true).describe("Include bio/description text"), include_summaries: z.boolean().optional().default(false).describe("Include AI-generated summaries") });
- src/server.ts:30-37 (registration)Registration of 'linkedin_search_exa' in the default enabledTools array in ExaServer constructor, enabling the tool for use.this.enabledTools = enabledTools || [ 'web_search_exa', 'company_research_exa', 'crawling_exa', 'linkedin_search_exa', 'deep_researcher_start', 'deep_researcher_check' ];
- src/formatters.ts:78-90 (helper)Helper function to format LinkedIn search results into a readable markdown structure with sections for people and companies.export function formatLinkedInResults(results: any): string { const sections = []; if (results.people) { sections.push('## LinkedIn Profiles\n' + formatSearchResults(results.people)); } if (results.companies) { sections.push('## LinkedIn Companies\n' + formatSearchResults(results.companies)); } return sections.join('\n\n---\n\n'); }
- src/client.ts:175-216 (helper)ExaClient method implementing the core LinkedIn search logic by performing targeted web searches restricted to LinkedIn domains.async searchLinkedIn(params: { query: string; search_type?: 'people' | 'companies' | 'both'; num_results?: number; include_bios?: boolean; include_summaries?: boolean; }) { try { const searchType = params.search_type || 'both'; const numResults = params.num_results || 10; const results: any = {}; if (searchType === 'people' || searchType === 'both') { const peopleSearch = await this.search({ query: `site:linkedin.com/in/ ${params.query}`, num_results: numResults, type: 'keyword', include_text: params.include_bios, include_summary: params.include_summaries }); results.people = peopleSearch; } if (searchType === 'companies' || searchType === 'both') { const companySearch = await this.search({ query: `site:linkedin.com/company/ ${params.query}`, num_results: numResults, type: 'keyword', include_text: params.include_bios, include_summary: params.include_summaries }); results.companies = companySearch; } return results; } catch (error) { throw new ExaError( error instanceof Error ? error.message : 'Failed to search LinkedIn', 'LINKEDIN_ERROR' ); } }