Skip to main content
Glama
ahmedselimmansor-ctrl

LinkedIn MCP Server

get_my_profile

Retrieve your LinkedIn profile information, including work experience, education, and skills, to access your professional data.

Instructions

Retrieve the authenticated user's LinkedIn profile information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The LinkedInClient.getMyProfile() method that executes the actual API call to LinkedIn's /userinfo endpoint to fetch the authenticated user's profile.
    async getMyProfile() {
      const response = await this.client.get("/userinfo");
      return response.data;
    }
  • The handleProfileTool function that handles the 'get_my_profile' tool case, calling client.getMyProfile() and returning the result as JSON text.
    export async function handleProfileTool(name: string, args: any, client: LinkedInClient) {
      switch (name) {
        case "get_my_profile": {
          const profile = await client.getMyProfile();
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(profile, null, 2),
              },
            ],
          };
        }
        default:
          throw new McpError(ErrorCode.MethodNotFound, `Unknown profile tool: ${name}`);
      }
    }
  • The tool registration metadata including name 'get_my_profile', description, and inputSchema (no required parameters).
    export const profileTools = [
      {
        name: "get_my_profile",
        description: "Retrieve the authenticated user's LinkedIn profile information.",
        inputSchema: {
          type: "object",
          properties: {},
        },
      },
    ];
  • src/index.ts:46-96 (registration)
    The MCP server registration where tools are listed via ListToolsRequestSchema and routed via CallToolRequestSchema. The 'get_my_profile' tool is included via spreading profileTools and routed via handleProfileTool.
    // Register tools
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          ...profileTools,
          ...contentTools,
          ...networkTools,
          ...organizationTools,
        ],
      };
    });
    
    // Handle tool execution
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      try {
        const name = request.params.name;
        const args = request.params.arguments;
    
        if (profileTools.some((t) => t.name === name)) {
          return await handleProfileTool(name, args, linkedinClient);
        }
        
        if (contentTools.some((t) => t.name === name)) {
          return await handleContentTool(name, args, linkedinClient);
        }
        
        if (networkTools.some((t) => t.name === name)) {
          return await handleNetworkTool(name, args, linkedinClient);
        }
        
        if (organizationTools.some((t) => t.name === name)) {
          return await handleOrganizationTool(name, args, linkedinClient);
        }
    
        throw new McpError(
          ErrorCode.MethodNotFound,
          `Unknown tool: ${name}`
        );
      } catch (error: any) {
        console.error("Error executing tool:", error);
        return {
          content: [
            {
              type: "text",
              text: `Error: ${error.message}`,
            },
          ],
          isError: true,
        };
      }
    });
  • Helper method getMyUrn() that also calls /userinfo to get the profile sub/ID, used to construct a URN for other API operations.
    async getMyUrn(): Promise<string> {
      const response = await this.client.get("/userinfo");
      return `urn:li:person:${response.data.sub}`;
    }
Behavior2/5

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

With no annotations, the description must fully disclose behavior. It only says 'Retrieve', implying a read operation, but lacks details on idempotency, rate limits, or any side effects.

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, clear sentence with no extraneous words. However, it is extremely minimal, which slightly reduces efficiency.

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, the description should hint at return fields (e.g., name, headline, etc.). It does not, leaving the agent uncertain about the tool's output.

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?

The input schema has zero parameters, so coverage is 100% by default. The description adds no extra meaning about what the profile contains, which is a missed opportunity for a 0-param tool (baseline 4, but no added value).

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 verb 'Retrieve' and the resource 'authenticated user's LinkedIn profile information', making it distinct from sibling tools like get_connections or get_organizations.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like get_connections. The description implicitly suggests it is for the current user, but no explicit context is given.

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/ahmedselimmansor-ctrl/Linekedin_MCP_server'

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