Skip to main content
Glama

send_message

Send personalized messages to LinkedIn contacts via the Linked API MCP server. Specify the recipient's LinkedIn URL and message text to streamline communication directly from your account.

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

  • The SendMessageTool class implements the 'send_message' tool. It specifies the name, the LinkedAPI operation name, the input schema for validation, and the MCP Tool object via getTool().
    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'], }, }; } }
  • The OperationTool base class provides the execute method, which is the core handler logic for the send_message tool. It locates the specific operation by name and executes it using executeWithProgress.
    export abstract class OperationTool<TParams, TResult> extends LinkedApiTool<TParams, TResult> { public abstract readonly operationName: TOperationName; 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, }); } }
  • The SendMessageTool is instantiated and added to the list of tools in LinkedApiTools constructor.
    new SendMessageTool(progressCallback),
  • Zod validation schema for send_message tool inputs.
    protected override readonly schema = z.object({ personUrl: z.string(), text: z.string().min(1), });
  • Import of SendMessageTool class.
    import { SendMessageTool } from './tools/send-message.js';

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