get_linkedin_user_posts
Retrieve LinkedIn posts for specific users using their URN identifier to access and analyze professional content and updates.
Instructions
Get LinkedIn posts for a user by URN (must include prefix, example: fsd_profile:ACoAAEWn01QBWENVMWqyM3BHfa1A-xsvxjdaXsY)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | Max posts | |
| timeout | No | Timeout in seconds | |
| urn | Yes | User URN (must include prefix, example: fsd_profile:ACoAA...) |
Implementation Reference
- src/index.ts:363-394 (handler)Tool registration with inline Zod schema for input validation and async handler function that normalizes/validates URN, makes HTTPS POST request to AnySite API endpoint for LinkedIn user posts, and returns JSON response or formatted error.server.tool( "get_linkedin_user_posts", "Get LinkedIn posts for a user by URN (must include prefix, example: fsd_profile:ACoAAEWn01Q...)", { urn: z.string().describe("User URN (must include prefix, example: fsd_profile:ACoAA...)"), count: z.number().default(10).describe("Max posts"), 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 posts lookup for urn:", normalizedURN); const requestData = { timeout, urn: normalizedURN, count }; try { const response = await makeRequest(API_CONFIG.ENDPOINTS.LINKEDIN_USER_POSTS, requestData); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] }; } catch (error) { log("LinkedIn user posts lookup error:", error); return { content: [{ type: "text", text: `LinkedIn user posts API error: ${formatError(error)}` }], isError: true }; } } );
- src/index.ts:366-370 (schema)Zod input schema defining parameters: urn (string, required), count (number, default 10), timeout (number, default 300).{ urn: z.string().describe("User URN (must include prefix, example: fsd_profile:ACoAA...)"), count: z.number().default(10).describe("Max posts"), timeout: z.number().default(300).describe("Timeout in seconds") },
- src/index.ts:88-93 (helper)Helper function 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; };
- src/index.ts:95-98 (helper)Helper function to validate if URN starts with 'fsd_profile:'.const isValidUserURN = (urn: string): boolean => { return urn.startsWith("fsd_profile:"); };
- src/index.ts:25-25 (helper)API endpoint constant used in makeRequest call for this tool.LINKEDIN_USER_POSTS: "/api/linkedin/user/posts",