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

remove_connection

Remove a LinkedIn connection by providing the person's profile URL. Disconnect from unwanted contacts in your network.

Instructions

Allows you to remove a person from your connections (st.removeConnection action).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
personUrlYesPublic or hashed LinkedIn URL of the person you want to remove from your connections. (e.g., 'https://www.linkedin.com/in/john-doe')

Implementation Reference

  • The RemoveConnectionTool class that handles the remove_connection tool. Extends OperationTool, defines the schema (personUrl string) and getTool() method for tool registration. The actual execution logic is inherited from OperationTool (in utils/linked-api-tool.ts) which calls linkedapi.operations.find(...) and executeWithProgress.
    import { OPERATION_NAME, TRemoveConnectionParams } from '@linkedapi/node';
    import { Tool } from '@modelcontextprotocol/sdk/types.js';
    import { z } from 'zod';
    
    import { OperationTool } from '../utils/linked-api-tool.js';
    
    export class RemoveConnectionTool extends OperationTool<TRemoveConnectionParams, unknown> {
      public override readonly name = 'remove_connection';
      public override readonly operationName = OPERATION_NAME.removeConnection;
      protected override readonly schema = z.object({
        personUrl: z.string(),
      });
    
      public override getTool(): Tool {
        return {
          name: this.name,
          description:
            'Allows you to remove a person from your connections (st.removeConnection action).',
          inputSchema: {
            type: 'object',
            properties: {
              personUrl: {
                type: 'string',
                description:
                  "Public or hashed LinkedIn URL of the person you want to remove from your connections. (e.g., 'https://www.linkedin.com/in/john-doe')",
              },
            },
            required: ['personUrl'],
          },
        };
      }
    }
  • Zod validation schema for remove_connection: requires a 'personUrl' string field.
    protected override readonly schema = z.object({
      personUrl: z.string(),
    });
  • Tool registration: RemoveConnectionTool is instantiated and added to the tools array in LinkedApiTools constructor.
    new RemoveConnectionTool(progressCallback),
  • OperationTool base class that provides the shared execute() implementation. It finds the matching operation by operationName and delegates to 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,
        });
      }
    }
  • Generic workflow execution helper that runs the operation's workflow, provides progress notifications, and handles timeout errors for all tools including remove_connection.
    import { LinkedApiWorkflowTimeoutError, Operation, TMappedResponse } from '@linkedapi/node';
    
    import { LinkedApiProgressNotification } from './types';
    
    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?

The description does not disclose any behavioral traits beyond the basic action. Since no annotations are provided, the description carries the full burden of transparency. It lacks details on destructiveness, authentication requirements, rate limits, or reversibility.

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

Conciseness5/5

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

The description is a single, efficient sentence that conveys the core functionality without any unnecessary words. It is front-loaded and to the point.

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

Completeness3/5

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

For a simple tool with one parameter and no output schema, the description provides the minimum viable context. However, it lacks behavioral details (e.g., success/error outcomes, side effects) that would make it more complete. With no annotations to supplement, it falls short.

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?

The input schema fully documents the single parameter (personUrl) with a clear description. The tool description adds no extra semantic information beyond what the schema provides. With 100% schema coverage, 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 tool's purpose: to remove a person from your connections. It specifies the underlying action (st.removeConnection) and implicitly differentiates from sibling tools like withdraw_connection_request which deals with pending requests.

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 guidance is provided on when to use this tool versus alternatives (e.g., withdraw_connection_request). There are no prerequisites or exclusions mentioned, leaving the agent to infer usage context from the tool name alone.

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