send_connection_request
Send LinkedIn connection requests to specific profiles using their URL, with optional personalized notes and email addresses when required.
Instructions
Allows you to send a connection request to a person (st.sendConnectionRequest action).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| personUrl | Yes | Public or hashed LinkedIn URL of the person you want to send a connection request to. (e.g., 'https://www.linkedin.com/in/john-doe') | |
| note | No | Optional. Note to include with the connection request. | |
| No | Optional. Email address required by some people for sending connection requests to them. If it is required and not provided, the connection request will fail. |
Implementation Reference
- Defines the SendConnectionRequestTool class, which implements the core logic for the 'send_connection_request' tool. It specifies the tool name, the LinkedAPI operation name, input validation schema, and the MCP tool definition including detailed input schema and description.export class SendConnectionRequestTool extends OperationTool< TSendConnectionRequestParams, unknown > { public override readonly name = 'send_connection_request'; public override readonly operationName = OPERATION_NAME.sendConnectionRequest; protected override readonly schema = z.object({ personUrl: z.string(), note: z.string().optional(), email: z.string().optional(), }); public override getTool(): Tool { return { name: this.name, description: 'Allows you to send a connection request to a person (st.sendConnectionRequest action).', inputSchema: { type: 'object', properties: { personUrl: { type: 'string', description: "Public or hashed LinkedIn URL of the person you want to send a connection request to. (e.g., 'https://www.linkedin.com/in/john-doe')", }, note: { type: 'string', description: 'Optional. Note to include with the connection request.', }, email: { type: 'string', description: 'Optional. Email address required by some people for sending connection requests to them. If it is required and not provided, the connection request will fail.', }, }, required: ['personUrl'], }, }; } }
- src/utils/linked-api-tool.ts:36-58 (helper)Base OperationTool class that provides the execute method, which is the actual handler logic. It locates the specific LinkedAPI operation by operationName and executes it with progress tracking.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:41-41 (registration)Registers the SendConnectionRequestTool instance in the LinkedApiTools collection by instantiating it and adding to the tools array.new SendConnectionRequestTool(progressCallback),
- src/linked-api-server.ts:22-23 (registration)In the MCP server, getTools() method exposes all tools including send_connection_request by calling getTool() on each.public getTools(): Tool[] { return this.tools.tools.map((tool) => tool.getTool());
- Zod schema defining input parameters for validation: personUrl (required), note (optional), email (optional). Also detailed in inputSchema of getTool().protected override readonly schema = z.object({ personUrl: z.string(), note: z.string().optional(), email: z.string().optional(), });