Skip to main content
Glama
felipfr

LinkedIn MCP Server

by felipfr

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

TableJSON Schema
NameRequiredDescriptionDefault
profileIdYesLinkedIn profile ID

Implementation Reference

  • 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)
  • 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
        }
      }
  • TypeScript type definition for the GetProfileParams interface used by both the handler and schema
    export interface GetProfileParams {
      publicId?: string
      urnId?: string
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of disclosure. It only says 'Access detailed LinkedIn profile information' without mentioning authentication requirements (likely needed, given sibling authenticate_linkedin), rate limits, what 'detailed' entails, or potential error conditions. The description is vague on behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, which is concise and easy to parse. However, it is overly minimal and could include more useful information without sacrificing brevity. It front-loads the purpose but lacks depth.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, no annotations, and a single parameter, the description is incomplete. It does not explain the return format, prerequisites (e.g., authentication), relationship to sibling tools (e.g., search_people, get_connections), or potential limitations. The tool's complexity is low, but the description fails to cover important context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with one parameter 'profileId' described as 'LinkedIn profile ID'. The description adds no additional meaning beyond the schema, meeting the baseline for full coverage. No extra context is provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool accesses 'detailed LinkedIn profile information for any user'. The verb 'access' and resource 'profile information' are specific, and the phrase 'for any user' distinguishes it from sibling tools like 'get_my_profile' (own profile) and 'get_company_profile' (company profile).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for any user, suggesting it is not for retrieving the authenticated user's profile (which would use get_my_profile) or company profiles (get_company_profile). However, it does not explicitly state when to use this tool over alternatives like search_people or when not to use it. The guidance is implicit rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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