get_post_reactions
Retrieve and analyze reactions on LinkedIn posts to understand engagement patterns and audience response.
Instructions
Get reactions on a LinkedIn post. Returns cleaned data in TOON format.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| post | Yes | LinkedIn post URL (required) | |
| page | No | Page number | |
| save_dir | No | Directory to save cleaned JSON data | |
| max_items | No | Maximum reactions (default: 10) |
Implementation Reference
- src/index.ts:929-943 (handler)The handler function that executes the tool logic: fetches reactions for a LinkedIn post via API, cleans and limits the results, formats the response in TOON format.private async getPostReactions(args: Record<string, any>): Promise<CallToolResult> { const params: Record<string, any> = { post: args.post }; if (args.page) params.page = args.page; const data = await this.makeRequest('/post-reactions', params); const maxItems = args.max_items || 10; const cleaned = (data.elements || []).slice(0, maxItems).map(DataCleaners.cleanReaction); return this.formatResponse(cleaned, { saveDir: args.save_dir, toolName: 'get_post_reactions', pagination: data.pagination, }); }
- src/index.ts:473-482 (schema)The input schema defining parameters: post (required), page, save_dir, max_items.inputSchema: { type: 'object', properties: { post: { type: 'string', description: 'LinkedIn post URL (required)' }, page: { type: 'integer', description: 'Page number', default: 1 }, save_dir: { type: 'string', description: 'Directory to save cleaned JSON data' }, max_items: { type: 'integer', description: 'Maximum reactions (default: 10)', default: 10 }, }, required: ['post'], },
- src/index.ts:471-483 (registration)Registration of the 'get_post_reactions' tool in the MCP server's tools array.name: 'get_post_reactions', description: 'Get reactions on a LinkedIn post. Returns cleaned data in TOON format.', inputSchema: { type: 'object', properties: { post: { type: 'string', description: 'LinkedIn post URL (required)' }, page: { type: 'integer', description: 'Page number', default: 1 }, save_dir: { type: 'string', description: 'Directory to save cleaned JSON data' }, max_items: { type: 'integer', description: 'Maximum reactions (default: 10)', default: 10 }, }, required: ['post'], }, } as Tool,
- src/index.ts:547-547 (registration)Dispatch case in the CallToolRequestHandler that routes to the getPostReactions handler.case 'get_post_reactions': return await this.getPostReactions(args as Record<string, any>);