Skip to main content
Glama

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
NameRequiredDescriptionDefault
personUrlYesPublic or hashed LinkedIn URL of the person you want to send a connection request to. (e.g., 'https://www.linkedin.com/in/john-doe')
noteNoOptional. Note to include with the connection request.
emailNoOptional. 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'], }, }; } }
  • 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, }); } }
  • Registers the SendConnectionRequestTool instance in the LinkedApiTools collection by instantiating it and adding to the tools array.
    new SendConnectionRequestTool(progressCallback),
  • 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(), });

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