send_connection_request
Send LinkedIn connection requests with an optional note or email using the Linked API MCP server. Input a person's LinkedIn URL to initiate contact directly through the tool.
Instructions
Allows you to send a connection request to a person (st.sendConnectionRequest action).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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. | ||
| note | No | Optional. Note to include with the connection request. | |
| 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') |
Implementation Reference
- The SendConnectionRequestTool class that defines the tool handler, including name 'send_connection_request', Zod schema for input validation, and the MCP Tool specification via getTool().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/linked-api-tools.ts:24-40 (registration)Imports and instantiates the SendConnectionRequestTool, adding it to the list of available tools in LinkedApiTools class.import { SendConnectionRequestTool } from './tools/send-connection-request.js'; import { SendMessageTool } from './tools/send-message.js'; import { WithdrawConnectionRequestTool } from './tools/withdraw-connection-request.js'; import { LinkedApiTool } from './utils/linked-api-tool.js'; import { LinkedApiProgressNotification } from './utils/types.js'; export class LinkedApiTools { public readonly tools: ReadonlyArray<LinkedApiTool<unknown, unknown>>; constructor(progressCallback: (progress: LinkedApiProgressNotification) => void) { this.tools = [ // Standard tools new SendMessageTool(progressCallback), new GetConversationTool(progressCallback), new CheckConnectionStatusTool(progressCallback), new RetrieveConnectionsTool(progressCallback), new SendConnectionRequestTool(progressCallback),
- src/utils/linked-api-tool.ts:39-57 (handler)The execute method in OperationTool base class, which performs the core tool execution by locating the operation by name and calling it with progress tracking.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-server.ts:22-23 (registration)In LinkedApiMCPServer, getTools() registers all tool specifications (including send_connection_request) for the MCP server.public getTools(): Tool[] { return this.tools.tools.map((tool) => tool.getTool());
- Zod schema for input parameters validation: personUrl (required), optional note and email.protected override readonly schema = z.object({ personUrl: z.string(), note: z.string().optional(), email: z.string().optional(), });