Skip to main content
Glama
Linked-API
by Linked-API

withdraw_connection_request

Withdraw a pending LinkedIn connection request by providing the person's profile URL. Optionally unfollow them to stop seeing updates.

Instructions

Allows you to withdraw the connection request sent to a person (st.withdrawConnectionRequest action).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
personUrlYesPublic or hashed LinkedIn URL of the person you want to withdraw the connection request from. (e.g., 'https://www.linkedin.com/in/john-doe')
unfollowNoOptional. Boolean indicating whether you want to unfollow the person when withdrawing the request. The default value is true.

Implementation Reference

  • The OperationTool base class provides the actual execute() handler for withdraw_connection_request. It looks up the operation by name from the LinkedApi client and runs it via 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,
        });
      }
    }
  • The WithdrawConnectionRequestTool class itself. It sets the tool name, operation name, and Zod schema, and provides the getTool() method returning the MCP Tool definition. It inherits execute() from OperationTool.
    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'],
          },
        };
      }
    }
  • The Zod schema defining input validation for the tool. Requires 'personUrl' (string) and optionally 'unfollow' (boolean).
    protected override readonly schema = z.object({
      personUrl: z.string(),
      unfollow: z.boolean().optional(),
    });
  • Where WithdrawConnectionRequestTool is instantiated and registered in the tools array.
    new WithdrawConnectionRequestTool(progressCallback),
  • The executeWithProgress helper used by OperationTool to run the operation with progress reporting and timeout handling.
    export async function executeWithProgress<TParams, TResult>(
      progressCallback: (progress: LinkedApiProgressNotification) => void,
      operation: Operation<TParams, TResult>,
      workflowTimeout: number,
      {
        params,
        workflowId,
        progressToken,
      }: { params?: TParams; workflowId?: string; progressToken?: string | number } = {},
    ): Promise<TMappedResponse<TResult>> {
      let progress = 0;
    
      progressCallback({
        progressToken,
        progress,
        total: 100,
        message: `Starting workflow ${operation.operationName}...`,
      });
    
      const interval = setInterval(
        () => {
          if (progress < 50) {
            progress += 5;
          } else if (progress < 98) {
            progress += 1;
          }
    
          progressCallback({
            progressToken,
            progress,
            total: 100,
            message: `Executing workflow ${operation.operationName}...`,
          });
        },
        Math.max(workflowTimeout / 20, 10000),
      );
    
      try {
        if (!workflowId) {
          workflowId = await operation.execute(params as TParams);
        }
        const result = await operation.result(workflowId, {
          timeout: workflowTimeout,
        });
        clearInterval(interval);
    
        progressCallback({
          progressToken,
          progress: 100,
          total: 100,
          message: `Workflow ${operation.operationName} completed successfully`,
        });
    
        return result;
      } catch (error) {
        clearInterval(interval);
        if (error instanceof LinkedApiWorkflowTimeoutError) {
          throw generateTimeoutError(error);
        }
    
        throw error;
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description should disclose behavioral traits like side effects or permissions, but it only restates the action. Missing details on whether the sender is notified or if there are rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One sentence, no wasted words. However, it is slightly under-specified for a tool without annotations.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the low complexity (2 params, no output schema), the description barely covers the basic purpose. Lacks usage guidance and behavioral transparency, making it barely adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema coverage is 100%, so the schema already explains both parameters. The description adds no extra meaning beyond the schema, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'withdraw' and the resource 'connection request sent to a person', distinguishing it from sibling tools like send_connection_request and remove_connection.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use or alternatives are provided. The description assumes the agent knows when to withdraw a request, and there is no comparison with similar sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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