Skip to main content
Glama
Jing-yilin

LinkedIn MCP Server

by Jing-yilin

search_profiles

Find LinkedIn profiles by name, company, location, or other filters to retrieve structured professional data for research, recruitment, or networking purposes.

Instructions

Search LinkedIn profiles by name, company, location. Returns cleaned data in TOON format.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchYesSearch profiles by name
currentCompanyNoFilter by current company ID or URL
pastCompanyNoFilter by past company ID or URL
schoolNoFilter by school ID or URL
firstNameNoFilter by first name
lastNameNoFilter by last name
titleNoFilter by job title
locationNoFilter by location text
geoIdNoFilter by LinkedIn Geo ID
industryIdNoFilter by industry ID
pageNoPage number
save_dirNoDirectory to save cleaned JSON data
max_itemsNoMaximum results (default: 10)

Implementation Reference

  • The handler function that implements the core logic for the 'search_profiles' tool. It constructs search parameters, calls the HarvestAPI /profile-search endpoint via makeRequest, cleans the results using DataCleaners.cleanProfileSearchResult, limits results, and formats the output in TOON with optional saving and pagination.
    private async searchProfiles(args: Record<string, any>): Promise<CallToolResult> { const params: Record<string, any> = { search: args.search }; if (args.currentCompany) params.currentCompany = args.currentCompany; if (args.pastCompany) params.pastCompany = args.pastCompany; if (args.school) params.school = args.school; if (args.firstName) params.firstName = args.firstName; if (args.lastName) params.lastName = args.lastName; if (args.title) params.title = args.title; if (args.location) params.location = args.location; if (args.geoId) params.geoId = args.geoId; if (args.industryId) params.industryId = args.industryId; if (args.page) params.page = args.page; const data = await this.makeRequest('/profile-search', params); const maxItems = args.max_items || 10; const cleaned = (data.elements || []).slice(0, maxItems).map(DataCleaners.cleanProfileSearchResult); return this.formatResponse(cleaned, { saveDir: args.save_dir, toolName: 'search_profiles', pagination: data.pagination, }); }
  • The tool definition including name, description, and input schema for validation. Defines parameters for searching profiles with required 'search' field and optional filters.
    name: 'search_profiles', description: 'Search LinkedIn profiles by name, company, location. Returns cleaned data in TOON format.', inputSchema: { type: 'object', properties: { search: { type: 'string', description: 'Search profiles by name' }, currentCompany: { type: 'string', description: 'Filter by current company ID or URL' }, pastCompany: { type: 'string', description: 'Filter by past company ID or URL' }, school: { type: 'string', description: 'Filter by school ID or URL' }, firstName: { type: 'string', description: 'Filter by first name' }, lastName: { type: 'string', description: 'Filter by last name' }, title: { type: 'string', description: 'Filter by job title' }, location: { type: 'string', description: 'Filter by location text' }, geoId: { type: 'string', description: 'Filter by LinkedIn Geo ID' }, industryId: { type: 'string', description: 'Filter by industry ID' }, page: { type: 'integer', description: 'Page number', default: 1 }, save_dir: { type: 'string', description: 'Directory to save cleaned JSON data' }, max_items: { type: 'integer', description: 'Maximum results (default: 10)', default: 10 }, }, required: ['search'], }, } as Tool,
  • src/index.ts:535-535 (registration)
    Registration in the CallToolRequestHandler switch statement that routes calls to the searchProfiles handler function.
    case 'search_profiles': return await this.searchProfiles(args as Record<string, any>);
  • Helper function cleanProfileSearchResult used by the handler to clean and simplify profile search results, extracting key fields like id, name, position, location.
    cleanProfileSearchResult(raw: any): any { if (!raw) return null; return { id: raw.id, name: raw.name, position: raw.position, location: raw.location?.linkedinText, linkedinUrl: raw.linkedinUrl, publicIdentifier: raw.publicIdentifier, }; },
  • src/index.ts:680-680 (registration)
    Tool name reference used in formatResponse for saving output files.
    toolName: 'search_profiles',

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Jing-yilin/linkedin-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server