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
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | Max reactions | |
| timeout | No | Timeout in seconds | |
| urn | Yes | User URN (must include prefix, example: fsd_profile:ACoAA...) |
Implementation Reference
- src/index.ts:397-427 (handler)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 }; } } );
- src/types.ts:37-41 (schema)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; }
- src/types.ts:484-493 (schema)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; }
- src/index.ts:88-92 (helper)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;
- src/index.ts:26-26 (helper)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",