Skip to main content
Glama

get_linkedin_user_reactions

Retrieve LinkedIn user reactions by providing a user URN to access engagement metrics and social interactions on the platform.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoMax reactions
timeoutNoTimeout in seconds
urnYesUser URN (must include prefix, example: fsd_profile:ACoAA...)

Implementation Reference

  • The primary handler implementation for the 'get_linkedin_user_reactions' tool. Registers the tool with MCP server, defines input schema using Zod, normalizes and validates user URN, calls the AnySite API endpoint for user reactions, and returns formatted JSON response or error.
    "get_linkedin_user_reactions", "Get LinkedIn reactions for a user by URN", { urn: z.string().describe("User URN (must include prefix, example: fsd_profile:ACoAA...)"), count: z.number().default(10).describe("Max reactions"), timeout: z.number().default(300).describe("Timeout in seconds") }, async ({ urn, count, timeout }) => { 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 reactions lookup for urn:", normalizedURN); const requestData = { timeout, urn: normalizedURN, count }; try { const response = await makeRequest(API_CONFIG.ENDPOINTS.LINKEDIN_USER_REACTIONS, requestData); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] }; } catch (error) { log("LinkedIn user reactions lookup error:", error); return { content: [{ type: "text", text: `LinkedIn user reactions API error: ${formatError(error)}` }], isError: true }; } } );
  • TypeScript interface defining the expected input arguments for the get_linkedin_user_reactions tool, matching the Zod schema used in the handler.
    export interface LinkedinUserReactionsArgs { urn: string; count?: number; timeout?: number; }
  • Type guard validation function for LinkedinUserReactionsArgs input type, ensuring proper structure and types before handler execution.
    export function isValidLinkedinUserReactionsArgs( args: unknown ): args is LinkedinUserReactionsArgs { if (typeof args !== "object" || args === null) return false; const obj = args as Record<string, unknown>; if (typeof obj.urn !== "string" || !obj.urn.trim()) return false; if (obj.count !== undefined && typeof obj.count !== "number") return false; if (obj.timeout !== undefined && typeof obj.timeout !== "number") return false; return true; }
  • Helper function used by the tool handler to normalize LinkedIn user URNs by ensuring the 'fsd_profile:' prefix is present.
    const normalizeUserURN = (urn: string): string => { if (!urn.includes("fsd_profile:")) { return `fsd_profile:${urn}`; } return urn;
  • API endpoint configuration constant used by the makeRequest helper to call the AnySite backend for fetching user reactions.
    LINKEDIN_USER_REACTIONS: "/api/linkedin/user/reactions",

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