Skip to main content
Glama
Gitmaxd

Unofficial dubco-mcp-server

by Gitmaxd

delete_link

Remove a short link from dub.co by providing its unique link ID to manage your URL shortening collection.

Instructions

Delete a short link on dub.co

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
linkIdYesThe ID of the link to delete

Implementation Reference

  • The main handler function that performs the deletion of a short link via the Dub.co API. Validates input, sends DELETE request, and handles responses or errors.
    private async deleteLink(args: any): Promise<any> {
      if (!args.linkId) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Link ID is required'
        );
      }
      
      try {
        const response = await this.axiosInstance.delete(`/links/${args.linkId}`);
        
        return {
          content: [
            {
              type: 'text',
              text: `Link with ID ${args.linkId} has been deleted.`,
            },
          ],
        };
      } catch (error) {
        if (axios.isAxiosError(error)) {
          const axiosError = error as AxiosError<any>;
          const statusCode = axiosError.response?.status;
          const errorData = axiosError.response?.data;
          
          // Debug logging
          console.error('Error data:', JSON.stringify(errorData));
          
          // Try to extract error message in different ways
          let errorMessage = 'Unknown error';
          if (errorData) {
            if (typeof errorData === 'string') {
              errorMessage = errorData;
            } else if (errorData.error) {
              // Handle nested error object from Dub.co API
              if (typeof errorData.error === 'object' && errorData.error.message) {
                errorMessage = errorData.error.message;
              } else {
                errorMessage = errorData.error;
              }
            } else if (errorData.message) {
              errorMessage = errorData.message;
            } else {
              errorMessage = JSON.stringify(errorData);
            }
          } else {
            errorMessage = axiosError.message;
          }
          
          return {
            content: [
              {
                type: 'text',
                text: `Error deleting link: ${statusCode} - ${errorMessage}`,
              },
            ],
            isError: true,
          };
        }
        
        throw error;
      }
    }
  • src/index.ts:160-173 (registration)
    Tool registration in the list of available tools, including name, description, and input schema definition.
    {
      name: 'delete_link',
      description: 'Delete a short link on dub.co',
      inputSchema: {
        type: 'object',
        properties: {
          linkId: {
            type: 'string',
            description: 'The ID of the link to delete',
          },
        },
        required: ['linkId'],
      },
    },
  • Input schema for the delete_link tool, specifying that 'linkId' is a required string.
    inputSchema: {
      type: 'object',
      properties: {
        linkId: {
          type: 'string',
          description: 'The ID of the link to delete',
        },
      },
      required: ['linkId'],
    },
  • src/index.ts:184-185 (registration)
    Dispatch case in the CallToolRequest handler that routes calls to the deleteLink method.
    case 'delete_link':
      return await this.deleteLink(request.params.arguments);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool deletes a link, implying a destructive mutation, but doesn't cover critical aspects like permission requirements, whether deletion is permanent or reversible, rate limits, or error handling. This leaves significant gaps in understanding the tool's behavior.

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 directly states the tool's purpose without any wasted words. It's front-loaded with the key action and resource, making it highly concise and well-structured for quick comprehension.

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 tool's complexity as a destructive operation with no annotations and no output schema, the description is incomplete. It fails to address important contextual details like what happens post-deletion (e.g., confirmation, error messages), side effects, or how it interacts with sibling tools, leaving the agent under-informed.

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 has 100% description coverage, with 'linkId' clearly documented as 'The ID of the link to delete'. The description doesn't add any extra meaning beyond this, such as format examples or sourcing details, but the schema adequately covers the parameter, so the baseline score of 3 is appropriate.

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

Purpose4/5

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

The description clearly states the action ('Delete') and resource ('a short link on dub.co'), making the purpose immediately understandable. It doesn't differentiate from sibling tools like 'create_link' or 'update_link', which would require mentioning it's for removal rather than creation or modification, so it falls short of a perfect score.

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 like 'update_link' for modifying links or 'create_link' for adding new ones. The description lacks context about prerequisites, such as needing an existing link ID, or exclusions, leaving the agent without usage direction.

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/Gitmaxd/dubco-mcp-server-npm'

If you have feedback or need assistance with the MCP directory API, please join our Discord server