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

send_message

Send LinkedIn messages to specific contacts using their profile URL and custom text, enabling direct professional communication through the Linked API MCP server.

Instructions

Allows you to send a message to a person (st.sendMessage action).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
personUrlYesLinkedIn URL of the person you want to send a message to (e.g., 'https://www.linkedin.com/in/john-doe')
textYesThe message text, must be up to 1900 characters.

Implementation Reference

  • Primary implementation of the 'send_message' tool: defines name, operation name, Zod schema for validation, and MCP tool specification via getTool(). Execution handled by inherited OperationTool.execute().
    export class SendMessageTool extends OperationTool<TSendMessageParams, unknown> {
      public override readonly name = 'send_message';
      public override readonly operationName = OPERATION_NAME.sendMessage;
      protected override readonly schema = z.object({
        personUrl: z.string(),
        text: z.string().min(1),
      });
    
      public override getTool(): Tool {
        return {
          name: this.name,
          description: 'Allows you to send a message to a person (st.sendMessage action).',
          inputSchema: {
            type: 'object',
            properties: {
              personUrl: {
                type: 'string',
                description:
                  "LinkedIn URL of the person you want to send a message to (e.g., 'https://www.linkedin.com/in/john-doe')",
              },
              text: {
                type: 'string',
                description: 'The message text, must be up to 1900 characters.',
              },
            },
            required: ['personUrl', 'text'],
          },
        };
      }
    }
  • Core execution handler for 'send_message' (and other operation tools): locates the specific LinkedAPI operation by operationName and executes it with 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,
      });
    }
  • Helper function invoked by OperationTool.execute: performs the actual workflow execution, progress notifications, result polling, and timeout handling for send_message.
    export async function executeWithProgress<TParams, TResult>(
      progressCallback: (progress: LinkedApiProgressNotification) => void,
      operation: Operation<TParams, TResult>,
      workflowTimeout: number,
      {
        params,
        workflowId,
        progressToken,
      }: { params?: TParams; workflowId?: string; progressToken?: string | number } = {},
    ): Promise<TMappedResponse<TResult>> {
      let progress = 0;
    
      progressCallback({
        progressToken,
        progress,
        total: 100,
        message: `Starting workflow ${operation.operationName}...`,
      });
    
      const interval = setInterval(
        () => {
          if (progress < 50) {
            progress += 5;
          } else if (progress < 98) {
            progress += 1;
          }
    
          progressCallback({
            progressToken,
            progress,
            total: 100,
            message: `Executing workflow ${operation.operationName}...`,
          });
        },
        Math.max(workflowTimeout / 20, 10000),
      );
    
      try {
        if (!workflowId) {
          workflowId = await operation.execute(params as TParams);
        }
        const result = await operation.result(workflowId, {
          timeout: workflowTimeout,
        });
        clearInterval(interval);
    
        progressCallback({
          progressToken,
          progress: 100,
          total: 100,
          message: `Workflow ${operation.operationName} completed successfully`,
        });
    
        return result;
      } catch (error) {
        clearInterval(interval);
        if (error instanceof LinkedApiWorkflowTimeoutError) {
          throw generateTimeoutError(error);
        }
    
        throw error;
      }
    }
  • Tool registration: instantiates SendMessageTool and includes it in the array of available tools.
    constructor(progressCallback: (progress: LinkedApiProgressNotification) => void) {
      this.tools = [
        // Standard tools
        new SendMessageTool(progressCallback),
        new GetConversationTool(progressCallback),
        new CheckConnectionStatusTool(progressCallback),
        new RetrieveConnectionsTool(progressCallback),
        new SendConnectionRequestTool(progressCallback),
        new WithdrawConnectionRequestTool(progressCallback),
        new RetrievePendingRequestsTool(progressCallback),
        new RemoveConnectionTool(progressCallback),
        new SearchCompaniesTool(progressCallback),
        new SearchPeopleTool(progressCallback),
        new FetchCompanyTool(progressCallback),
        new FetchPersonTool(progressCallback),
        new FetchPostTool(progressCallback),
        new ReactToPostTool(progressCallback),
        new CommentOnPostTool(progressCallback),
        new CreatePostTool(progressCallback),
        new RetrieveSSITool(progressCallback),
        new RetrievePerformanceTool(progressCallback),
        // Sales Navigator tools
        new NvSendMessageTool(progressCallback),
        new NvGetConversationTool(progressCallback),
        new NvSearchCompaniesTool(progressCallback),
        new NvSearchPeopleTool(progressCallback),
        new NvFetchCompanyTool(progressCallback),
        new NvFetchPersonTool(progressCallback),
        // Other tools
        new ExecuteCustomWorkflowTool(progressCallback),
        new GetWorkflowResultTool(progressCallback),
        new GetApiUsageTool(progressCallback),
      ];
  • MCP server registration: exposes send_message tool specification by mapping all tools to their MCP Tool objects via getTool().
    public getTools(): Tool[] {
      return this.tools.tools.map((tool) => tool.getTool());
    }
  • Zod schema for input validation of send_message parameters.
    protected override readonly schema = z.object({
      personUrl: z.string(),
      text: z.string().min(1),
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden but only states the action without behavioral details. It doesn't disclose permissions needed, rate limits, whether it's a read/write operation, or what happens on success/failure. This is inadequate for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function. However, it could be more front-loaded by specifying the platform (e.g., LinkedIn) and lacks structural elements like bullet points, though it avoids unnecessary verbosity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain return values, error conditions, or behavioral constraints, leaving significant gaps in understanding how to invoke and interpret results from this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the input schema fully documents both parameters. The description adds no additional meaning beyond implying the tool sends messages, which is already clear from the name and schema. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool's purpose as 'send a message to a person' with the specific action 'st.sendMessage action', which is clear but lacks differentiation from sibling tools like 'nv_send_message'. It doesn't specify what type of message (e.g., LinkedIn direct message) or distinguish it from other communication tools like 'comment_on_post'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a connection), exclusions, or compare it to similar tools like 'nv_send_message' or 'comment_on_post', leaving the agent to infer usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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