Skip to main content
Glama
felipfr

LinkedIn MCP Server

by felipfr

get_profile

Retrieve detailed LinkedIn profile data using profile ID to gain insights, network analytics, and user information for strategic decision-making.

Instructions

Access detailed LinkedIn profile information for any user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
profileIdYesLinkedIn profile ID

Implementation Reference

  • Core handler function that fetches LinkedIn profile by publicId or urnId using authenticated API request
    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/server.ts:85-102 (registration)
    MCP tool registration for 'get-profile', including inline handler that delegates to clientService
    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
        }
      }
    )
  • Zod input schema for getProfile tool parameters
    getProfile: {
      publicId: z.string().optional().describe('Public ID of the LinkedIn profile'),
      urnId: z.string().optional().describe('URN ID of the LinkedIn profile')
    },
  • TypeScript interface defining input parameters for getProfile
    export interface GetProfileParams {
      publicId?: string
      urnId?: string
    }

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/felipfr/linkedin-mcpserver'

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