Skip to main content
Glama
Linked-API
by Linked-API

react_to_post

Add reactions to LinkedIn posts using available types like like, love, support, celebrate, insightful, or funny to engage with content.

Instructions

Allows you to react to a post using any available reaction type (st.reactToPost action).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
postUrlYesLinkedIn URL of the post to react. (e.g., 'https://www.linkedin.com/posts/username_activity-id')
typeYesEnum describing the reaction type.

Implementation Reference

  • ReactToPostTool class: defines the tool name 'react_to_post', LinkedIn operation name, Zod validation schema, and MCP Tool object with inputSchema. Inherits execution logic from OperationTool.
    export class ReactToPostTool extends OperationTool<TReactToPostParams, unknown> {
      public override readonly name = 'react_to_post';
      public override readonly operationName = OPERATION_NAME.reactToPost;
      protected override readonly schema = z.object({
        postUrl: z.string(),
        type: z.enum(['like', 'love', 'celebrate', 'support', 'funny', 'insightful']).or(z.string()),
      });
    
      public override getTool(): Tool {
        return {
          name: this.name,
          description:
            'Allows you to react to a post using any available reaction type (st.reactToPost action).',
          inputSchema: {
            type: 'object',
            properties: {
              postUrl: {
                type: 'string',
                description:
                  "LinkedIn URL of the post to react. (e.g., 'https://www.linkedin.com/posts/username_activity-id')",
              },
              type: {
                type: 'string',
                description: 'Enum describing the reaction type.',
                enum: ['like', 'love', 'support', 'celebrate', 'insightful', 'funny'],
              },
            },
            required: ['postUrl', 'type'],
          },
        };
      }
    }
  • Execute method in OperationTool (base class for ReactToPostTool): finds the LinkedAPI operation matching 'reactToPost' and executes it with input args and progress reporting.
    public override execute({
      linkedapi,
      args,
      workflowTimeout,
      progressToken,
    }: {
      linkedapi: LinkedApi;
      args: TParams;
      workflowTimeout: number;
      progressToken?: string | number;
    }): Promise<TMappedResponse<TResult>> {
      const operation = linkedapi.operations.find(
        (operation) => operation.operationName === this.operationName,
      )! as Operation<TParams, TResult>;
      return executeWithProgress(this.progressCallback, operation, workflowTimeout, {
        params: args,
        progressToken,
      });
    }
  • Zod schema for validating react_to_post input parameters: postUrl (string) and type (reaction enum or string).
    protected override readonly schema = z.object({
      postUrl: z.string(),
      type: z.enum(['like', 'love', 'celebrate', 'support', 'funny', 'insightful']).or(z.string()),
    });
  • Instantiation of ReactToPostTool within the LinkedApiTools constructor's tools array, registering it for use in the MCP server.
    new ReactToPostTool(progressCallback),
  • Initialization of LinkedApiTools in LinkedApiServer, which includes the react_to_post tool among others, for provision to the MCP server.
    this.tools = new LinkedApiTools(progressCallback);

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/Linked-API/linkedapi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server