get_profile
Retrieve detailed LinkedIn profile data by supplying a profile ID. Access user information for analysis or integration.
Instructions
Access detailed LinkedIn profile information for any user
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profileId | Yes | LinkedIn profile ID |
Implementation Reference
- src/services/client.service.ts:122-141 (handler)The core handler function that executes the get_profile tool logic. It accepts publicId or urnId, constructs the appropriate LinkedIn API endpoint, and fetches profile data including details like positions, education, skills, etc.
public async getProfile(params: GetProfileParams): Promise<LinkedInProfile> { if (!params.publicId && !params.urnId) { throw new Error('Either publicId or urnId must be provided') } const idTypeMapping: Record<string, () => string> = { publicId: () => `/people/${params.publicId}`, urnId: () => `/people/${encodeURIComponent(params.urnId as string)}` } const idType = Object.keys(idTypeMapping).find((key) => params[key as keyof GetProfileParams]) if (!idType) { throw new Error('No valid ID provided') } const endpoint = idTypeMapping[idType]() + '?projection=(id,firstName,lastName,profilePicture,headline,summary,industry,location,positions,educations,skills)' return this.makeRequest<LinkedInProfile>('get', endpoint) - src/schemas/linkedin.schema.ts:28-31 (schema)Zod schema defining the input parameters for get_profile tool: optional publicId and urnId fields
getProfile: { publicId: z.string().optional().describe('Public ID of the LinkedIn profile'), urnId: z.string().optional().describe('URN ID of the LinkedIn profile') }, - src/server.ts:84-101 (registration)Registration of the 'get-profile' tool on the MCP server, wiring the schema to the handler callback that calls clientService.getProfile
// Get Profile Tool this.server.tool( 'get-profile', 'Retrieve detailed LinkedIn profile information', linkedinApiSchemas.getProfile, async (params) => { this.logger.info('Retrieving LinkedIn Profile', { publicId: params.publicId, urnId: params.urnId }) try { const profile = await this.clientService.getProfile(params) return this.createResourceResponse(profile) } catch (error) { this.logger.error('LinkedIn Profile Retrieval Failed', error) throw error } } - src/types/linkedin.d.ts:12-15 (schema)TypeScript type definition for the GetProfileParams interface used by both the handler and schema
export interface GetProfileParams { publicId?: string urnId?: string }