Skip to main content
Glama

get_linkedin_user_comments

Retrieve LinkedIn user comments by providing a user URN to analyze engagement patterns and discussion activity on the platform.

Instructions

Get LinkedIn comments for a user by URN (must include prefix, example: fsd_profile:ACoAA...)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commented_afterNoFilter comments that created after the specified date. Accepts timestamp
countNoMax comments
timeoutNoTimeout in seconds
urnYesUser URN (must include prefix, example: fsd_profile:ACoAA...)

Implementation Reference

  • Core execution logic for get_linkedin_user_comments tool: normalizes URN, validates format, calls AnySite API /api/linkedin/user/comments, returns JSON or error.
    async ({ urn, count, timeout, commented_after }) => {
      const normalizedURN = normalizeUserURN(urn);
      if (!isValidUserURN(normalizedURN)) {
        return {
          content: [{ type: "text", text: "Invalid URN format. Must start with 'fsd_profile:'" }],
          isError: true
        };
      }
      log("Starting LinkedIn user comments lookup for urn:", normalizedURN);
      const requestData: any = { timeout, urn: normalizedURN, count };
      if (commented_after !== undefined) {
        requestData.commented_after = commented_after;
      }
      try {
        const response = await makeRequest(API_CONFIG.ENDPOINTS.LINKEDIN_USER_COMMENTS, requestData);
        return {
          content: [{ type: "text", text: JSON.stringify(response, null, 2) }]
        };
      } catch (error) {
        log("LinkedIn user comments lookup error:", error);
        return {
          content: [{ type: "text", text: `LinkedIn user comments API error: ${formatError(error)}` }],
          isError: true
        };
      }
    }
  • Zod input validation schema defining parameters for the tool.
    {
      urn: z.string().describe("User URN (must include prefix)"),
      count: z.number().default(10).describe("Max comments"),
      timeout: z.number().default(300).describe("Timeout in seconds"),
      commented_after: z.number().optional().describe("Filter comments after timestamp")
    },
  • src/index.ts:429-464 (registration)
    MCP server.tool registration including name, description, schema, and inline handler.
    server.tool(
      "get_linkedin_user_comments",
      "Get LinkedIn comments for a user by URN",
      {
        urn: z.string().describe("User URN (must include prefix)"),
        count: z.number().default(10).describe("Max comments"),
        timeout: z.number().default(300).describe("Timeout in seconds"),
        commented_after: z.number().optional().describe("Filter comments after timestamp")
      },
      async ({ urn, count, timeout, commented_after }) => {
        const normalizedURN = normalizeUserURN(urn);
        if (!isValidUserURN(normalizedURN)) {
          return {
            content: [{ type: "text", text: "Invalid URN format. Must start with 'fsd_profile:'" }],
            isError: true
          };
        }
        log("Starting LinkedIn user comments lookup for urn:", normalizedURN);
        const requestData: any = { timeout, urn: normalizedURN, count };
        if (commented_after !== undefined) {
          requestData.commented_after = commented_after;
        }
        try {
          const response = await makeRequest(API_CONFIG.ENDPOINTS.LINKEDIN_USER_COMMENTS, requestData);
          return {
            content: [{ type: "text", text: JSON.stringify(response, null, 2) }]
          };
        } catch (error) {
          log("LinkedIn user comments lookup error:", error);
          return {
            content: [{ type: "text", text: `LinkedIn user comments API error: ${formatError(error)}` }],
            isError: true
          };
        }
      }
    );
  • Helper to normalize LinkedIn user URN by prepending 'fsd_profile:' if missing.
    const normalizeUserURN = (urn: string): string => {
      if (!urn.includes("fsd_profile:")) {
        return `fsd_profile:${urn}`;
      }
      return urn;
  • API endpoint URL constant used in the tool's makeRequest call.
    LINKEDIN_USER_COMMENTS: "/api/linkedin/user/comments",
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the URN format requirement but fails to describe key behaviors such as pagination, rate limits, authentication needs, error handling, or the structure of returned comments. This leaves significant gaps for an agent to understand how the tool operates.

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, efficient sentence that front-loads the core purpose and includes a helpful example. It avoids unnecessary words, though it could be slightly more structured by separating guidelines from the core statement.

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 the lack of annotations and output schema, the description is incomplete. It does not explain what the tool returns (e.g., comment objects, metadata), error conditions, or behavioral constraints like rate limits. For a tool with 4 parameters and no structured output, more contextual information is needed for effective use.

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 description coverage is 100%, so the input schema fully documents all parameters. The description adds minimal value by reiterating the URN format example, which is already in the schema, and does not provide additional context like default behaviors or usage tips. This meets the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the action ('Get LinkedIn comments') and resource ('for a user by URN'), providing a specific example of the required URN format. However, it does not explicitly differentiate this tool from sibling tools like 'get_linkedin_post_comments' or 'get_linkedin_user_posts', which reduces the score from a 5.

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?

The description provides no guidance on when to use this tool versus alternatives, such as 'get_linkedin_post_comments' for comments on a specific post or 'get_linkedin_user_posts' for user posts. It lacks context on prerequisites, exclusions, or comparisons with sibling tools, offering only basic parameter instructions.

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

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