Skip to main content
Glama

get_linkedin_profile

Retrieve detailed LinkedIn profile data including work experience, education history, and professional skills by providing a user alias, URL, or URN.

Instructions

Get detailed information about a LinkedIn user profile

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userYesUser alias, URL, or URN
with_educationNoInclude education info
with_experienceNoInclude experience info
with_skillsNoInclude skills info

Implementation Reference

  • Handler function that executes the get_linkedin_profile tool: constructs request data, calls the AnySite API endpoint for LinkedIn user profile, returns JSON response or error.
    async ({ user, with_experience, with_education, with_skills }) => {
      const requestData = { timeout: 300, user, with_experience, with_education, with_skills };
      log("Starting LinkedIn profile lookup for:", user);
      try {
        const response = await makeRequest(API_CONFIG.ENDPOINTS.USER_PROFILE, requestData);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(response, null, 2)
            }
          ]
        };
      } catch (error) {
        log("LinkedIn profile lookup error:", error);
        return {
          content: [
            {
              type: "text",
              text: `LinkedIn API error: ${formatError(error)}`
            }
          ],
          isError: true
        };
      }
    }
  • Input schema using Zod for validating parameters: user (required string), optional booleans for including experience, education, skills.
      user: z.string().describe("User alias, URL, or URN"),
      with_experience: z.boolean().default(true).describe("Include experience info"),
      with_education: z.boolean().default(true).describe("Include education info"),
      with_skills: z.boolean().default(true).describe("Include skills info")
    },
  • src/index.ts:223-257 (registration)
    Registration of the get_linkedin_profile tool on the MCP server using server.tool(), including name, description, input schema, and handler function.
      "get_linkedin_profile",
      "Get detailed information about a LinkedIn user profile",
      {
        user: z.string().describe("User alias, URL, or URN"),
        with_experience: z.boolean().default(true).describe("Include experience info"),
        with_education: z.boolean().default(true).describe("Include education info"),
        with_skills: z.boolean().default(true).describe("Include skills info")
      },
      async ({ user, with_experience, with_education, with_skills }) => {
        const requestData = { timeout: 300, user, with_experience, with_education, with_skills };
        log("Starting LinkedIn profile lookup for:", user);
        try {
          const response = await makeRequest(API_CONFIG.ENDPOINTS.USER_PROFILE, requestData);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(response, null, 2)
              }
            ]
          };
        } catch (error) {
          log("LinkedIn profile lookup error:", error);
          return {
            content: [
              {
                type: "text",
                text: `LinkedIn API error: ${formatError(error)}`
              }
            ],
            isError: true
          };
        }
      }
    );
  • API endpoint constant used by the handler: '/api/linkedin/user' for fetching LinkedIn user profiles.
    USER_PROFILE: "/api/linkedin/user",
  • TypeScript interface defining the input arguments for LinkedIn user profile, matching the Zod schema used in the tool.
    export interface LinkedinUserProfileArgs {
      user: string;
      with_experience?: boolean;
      with_education?: boolean;
      with_skills?: boolean;
    }

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/anysiteio/hdw-mcp-server'

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