Skip to main content
Glama

delete_link

Remove a short link from your Dub.co account by specifying its unique identifier to manage your URL shortening inventory.

Instructions

Delete a short link on dub.co

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
linkIdYesThe ID of the link to delete

Implementation Reference

  • The primary handler function for the 'delete_link' tool. It validates the linkId parameter, makes a DELETE request to the Dub.co API endpoint `/links/{linkId}`, and returns a success message or formatted error response.
    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<ApiErrorResponse>;
          const statusCode = axiosError.response?.status;
          const errorData = axiosError.response?.data;
          const errorMessage = errorData?.error || errorData?.message || axiosError.message;
          
          return {
            content: [
              {
                type: 'text',
                text: `Error deleting link: ${statusCode} - ${errorMessage}`,
              },
            ],
            isError: true,
          };
        }
        
        throw error;
      }
    }
  • The input schema for the 'delete_link' tool, defining the required 'linkId' parameter as a string.
    inputSchema: {
      type: 'object',
      properties: {
        linkId: {
          type: 'string',
          description: 'The ID of the link to delete',
        },
      },
      required: ['linkId'],
    },
  • src/index.ts:182-195 (registration)
    Registration of the 'delete_link' tool in the ListTools response, including name, description, and input schema.
    {
      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'],
      },
    },
  • src/index.ts:208-209 (registration)
    Dispatcher case in the CallToolRequest handler that routes 'delete_link' 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 mention whether this action is reversible, what permissions are required, how it affects associated data, or what happens on success/failure. For a destructive operation, this lack of detail is a significant gap, leaving the agent with insufficient information about behavioral traits.

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, direct sentence that efficiently conveys the core action without unnecessary words. It's front-loaded with the key verb 'Delete' and specifies the resource clearly. There's zero waste, making it easy for an agent to parse quickly while still being informative enough for basic understanding.

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 destructive nature (deletion), no annotations, and no output schema, the description is incomplete. It doesn't address critical context like what 'delete' entails (permanent vs. soft delete), error handling, or return values. For a mutation tool with zero annotation coverage, the description should provide more behavioral and outcome details to be sufficiently complete for safe agent use.

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 the single parameter 'linkId' clearly documented as 'The ID of the link to delete'. The description doesn't add any additional meaning beyond this, such as format examples or sourcing instructions. Given the high schema coverage, a baseline score of 3 is appropriate, as the schema adequately handles parameter semantics without extra help from the description.

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 explicitly differentiate from sibling tools like 'create_link' or 'update_link', but the verb 'Delete' inherently distinguishes it from creation and modification operations. The description is specific enough to understand what the tool does without being tautological.

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?

The description provides no guidance on when to use this tool versus alternatives like 'update_link' or 'upsert_link'. It doesn't mention prerequisites (e.g., needing an existing link ID), error conditions, or typical use cases. While the action is clear, there's no context to help an agent decide between this and other link management tools in the sibling set.

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'

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