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
| Name | Required | Description | Default |
|---|---|---|---|
| personUrl | Yes | LinkedIn URL of the person you want to send a message to (e.g., 'https://www.linkedin.com/in/john-doe') | |
| text | Yes | The message text, must be up to 1900 characters. |
Implementation Reference
- src/tools/send-message.ts:7-36 (handler)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'], }, }; } }
- src/utils/linked-api-tool.ts:36-58 (handler)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, }); } }
- src/linked-api-tools.ts:36-36 (registration)The SendMessageTool is instantiated and added to the list of tools in LinkedApiTools constructor.new SendMessageTool(progressCallback),
- src/tools/send-message.ts:10-13 (schema)Zod validation schema for send_message tool inputs.protected override readonly schema = z.object({ personUrl: z.string(), text: z.string().min(1), });
- src/linked-api-tools.ts:25-25 (registration)Import of SendMessageTool class.import { SendMessageTool } from './tools/send-message.js';