linkedin_react
React to LinkedIn posts with likes, celebrates, or other reactions using post URLs or URNs. This tool enables immediate engagement with LinkedIn content through the MCP server.
Instructions
React to a LinkedIn post via Unipile. Accepts a LinkedIn post URL (e.g. https://linkedin.com/feed/update/urn:li:activity:12345) or a raw URN (urn:li:activity:12345). This action is immediate — there is no dry_run. Reaction type defaults to 'like' if not specified.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| post_url | Yes | LinkedIn post URL (linkedin.com/feed/update/...) or raw URN (urn:li:activity:...) | |
| reaction_type | No | Reaction type. One of: like, celebrate, support, love, insightful, funny. Defaults to "like". | like |
Implementation Reference
- src/tools/react.js:25-66 (handler)The `handleReact` function processes the `linkedin_react` tool request, validating input arguments and using the Unipile client to react to a LinkedIn post.
export async function handleReact(args) { const { post_url, reaction_type = "like" } = args; if ( !post_url || typeof post_url !== "string" || post_url.trim().length === 0 ) { return { error: "post_url is required" }; } if (!VALID_REACTIONS.includes(reaction_type)) { return { error: `Invalid reaction_type: "${reaction_type}". Must be one of: ${VALID_REACTIONS.join(", ")}`, }; } const urn = parsePostUrn(post_url); if (!urn) { return { error: `Could not parse post URN from: "${post_url}". Provide a LinkedIn post URL or raw URN.`, }; } const accountResult = await resolveAccountId(); if (!accountResult.success) { return { error: `Could not resolve LinkedIn account: ${accountResult.error}`, }; } const result = await reactToPost(accountResult.data, urn, reaction_type); if (!result.success) { return { error: result.error, details: result.details }; } return { status: "reacted", post_urn: urn, reaction_type, }; } - src/server.js:94-119 (schema)The `linkedin_react` tool registration defines the name, description, input schema, and parameters, including validation for `post_url` and `reaction_type`.
name: "linkedin_react", description: "React to a LinkedIn post via Unipile. " + "Accepts a LinkedIn post URL (e.g. https://linkedin.com/feed/update/urn:li:activity:12345) " + "or a raw URN (urn:li:activity:12345). " + "This action is immediate — there is no dry_run. " + "Reaction type defaults to 'like' if not specified.", inputSchema: { type: "object", properties: { post_url: { type: "string", description: "LinkedIn post URL (linkedin.com/feed/update/...) or raw URN (urn:li:activity:...)", }, reaction_type: { type: "string", enum: ["like", "celebrate", "support", "love", "insightful", "funny"], description: 'Reaction type. One of: like, celebrate, support, love, insightful, funny. Defaults to "like".', default: "like", }, }, required: ["post_url"], }, }, - src/server.js:148-150 (registration)The `linkedin_react` tool is registered in the `CallToolRequestSchema` handler in `src/server.js`, routing the request to the `handleReact` function.
case "linkedin_react": result = await handleReact(args || {}); break;