withdraw_connection_request
Remove a pending LinkedIn connection request to a specific person, optionally unfollowing them. Use this tool via Linked API MCP to manage your LinkedIn network efficiently.
Instructions
Allows you to withdraw the connection request sent to a person (st.withdrawConnectionRequest action).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| personUrl | Yes | Public or hashed LinkedIn URL of the person you want to withdraw the connection request from. (e.g., 'https://www.linkedin.com/in/john-doe') | |
| unfollow | No | Optional. Boolean indicating whether you want to unfollow the person when withdrawing the request. The default value is true. |
Implementation Reference
- WithdrawConnectionRequestTool class: defines the tool name 'withdraw_connection_request', LinkedIn operation name, Zod schema for validation, and MCP tool specification via getTool() including detailed inputSchema and description.export class WithdrawConnectionRequestTool extends OperationTool< TWithdrawConnectionRequestParams, unknown > { public override readonly name = 'withdraw_connection_request'; public override readonly operationName = OPERATION_NAME.withdrawConnectionRequest; protected override readonly schema = z.object({ personUrl: z.string(), unfollow: z.boolean().optional(), }); public override getTool(): Tool { return { name: this.name, description: 'Allows you to withdraw the connection request sent to a person (st.withdrawConnectionRequest action).', inputSchema: { type: 'object', properties: { personUrl: { type: 'string', description: "Public or hashed LinkedIn URL of the person you want to withdraw the connection request from. (e.g., 'https://www.linkedin.com/in/john-doe')", }, unfollow: { type: 'boolean', description: 'Optional. Boolean indicating whether you want to unfollow the person when withdrawing the request. The default value is true.', }, }, required: ['personUrl'], }, }; } }
- src/utils/linked-api-tool.ts:39-57 (handler)execute() method in OperationTool base class: the core handler logic that finds the specific LinkedIn API operation by operationName ('withdrawConnectionRequest') and executes it with input params and progress reporting.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, }); }
- Internal Zod schema for parsing and validating tool input arguments (personUrl required, unfollow optional).protected override readonly schema = z.object({ personUrl: z.string(), unfollow: z.boolean().optional(), });
- src/linked-api-tools.ts:34-64 (registration)Registration of WithdrawConnectionRequestTool instance in the LinkedApiTools class constructor, added to the readonly tools array alongside other LinkedIn API tools.this.tools = [ // Standard tools new SendMessageTool(progressCallback), new GetConversationTool(progressCallback), new CheckConnectionStatusTool(progressCallback), new RetrieveConnectionsTool(progressCallback), new SendConnectionRequestTool(progressCallback), new WithdrawConnectionRequestTool(progressCallback), new RetrievePendingRequestsTool(progressCallback), new RemoveConnectionTool(progressCallback), new SearchCompaniesTool(progressCallback), new SearchPeopleTool(progressCallback), new FetchCompanyTool(progressCallback), new FetchPersonTool(progressCallback), new FetchPostTool(progressCallback), new ReactToPostTool(progressCallback), new CommentOnPostTool(progressCallback), new RetrieveSSITool(progressCallback), new RetrievePerformanceTool(progressCallback), // Sales Navigator tools new NvSendMessageTool(progressCallback), new NvGetConversationTool(progressCallback), new NvSearchCompaniesTool(progressCallback), new NvSearchPeopleTool(progressCallback), new NvFetchCompanyTool(progressCallback), new NvFetchPersonTool(progressCallback), // Other tools new ExecuteCustomWorkflowTool(progressCallback), new GetWorkflowResultTool(progressCallback), new GetApiUsageTool(progressCallback), ];
- src/utils/linked-api-tool.ts:36-58 (helper)OperationTool abstract base class extended by WithdrawConnectionRequestTool, providing the shared execution logic for all operation-based tools.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, }); } }