Skip to main content
Glama
muleiwu

DWZ Short URL MCP Server

by muleiwu

delete_short_url

Remove a short URL from the DWZ Short URL MCP Server to manage your link collection. This action permanently deletes the specified URL and cannot be undone.

Instructions

删除指定的短网址。删除后无法恢复,请谨慎操作。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes要删除的短网址ID

Implementation Reference

  • Defines the MCP tool 'delete_short_url' including its handler function that validates input, calls the short link service to delete the URL, and returns a success response.
    export const deleteShortUrlTool = {
      name: 'delete_short_url',
      description: '删除指定的短网址。删除后无法恢复,请谨慎操作。',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'integer',
            description: '要删除的短网址ID',
            minimum: 1,
          },
        },
        required: ['id'],
      },
    
      handler: async function (args) {
        logger.info('MCP工具调用: delete_short_url', { args });
    
        return ErrorHandler.asyncWrapper(async () => {
          const result = await defaultShortLinkService.deleteShortUrl(args.id);
    
          return {
            success: true,
            message: '短网址删除成功',
            data: {
              id: args.id,
              deleted: true,
            },
            meta: {
              operation: 'delete_short_url',
              timestamp: new Date().toISOString(),
            },
          };
        })();
      },
    };
  • Registers the deleteShortUrlTool (imported as deleteShortUrlTool) along with other tools in the MCP server's tool map.
    registerTools() {
      const tools = [
        createShortUrlTool,
        getUrlInfoTool,
        listShortUrlsTool,
        deleteShortUrlTool,
        batchCreateShortUrlsTool,
        listDomainsTool,
      ];
    
      for (const tool of tools) {
        this.tools.set(tool.name, tool);
        logger.debug(`注册工具: ${tool.name}`);
      }
    
      logger.info(`已注册 ${tools.length} 个工具`);
    }
  • The core deleteShortUrl method in the ShortLinkService that sends HTTP DELETE request to the remote API to delete the short URL by ID.
    async deleteShortUrl(id) {
      try {
        // 验证参数
        validateOrThrow('deleteShortUrl', { id });
    
        logger.info('开始删除短链接:', { id });
    
        // 发送请求
        const response = await this.httpClient.delete(
          getApiUrl(`/short_links/${id}`)
        );
    
        // 处理响应
        const result = this.handleApiResponse(response, '删除短链接');
    
        logger.info('短链接删除成功:', { id });
    
        return result;
    
      } catch (error) {
        logger.error('删除短链接失败:', error);
        const handledError = ErrorHandler.handle(error);
        throw ErrorHandler.createMcpErrorResponse(handledError, error);
      }
    }
  • Joi validation schema for deleteShortUrl input parameters used by the service.
    deleteShortUrl: Joi.object({
      id: commonRules.id,
    }),
Behavior4/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 effectively communicates key behavioral traits: it is a destructive operation ('删除后无法恢复' meaning cannot be recovered after deletion) and requires caution ('请谨慎操作' meaning please operate carefully). This covers safety aspects well, though it could add more context like authentication needs or rate limits for a higher score.

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 extremely concise and front-loaded, consisting of just two short sentences that directly state the purpose and critical warning. Every sentence earns its place by providing essential information without any waste, making it highly efficient and well-structured for an AI agent.

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

Completeness4/5

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

Given the tool's complexity (a destructive delete operation), lack of annotations, and no output schema, the description does a good job of covering key aspects: purpose, irreversible nature, and caution. However, it could be more complete by mentioning potential side effects (e.g., impact on linked data) or response format, which would help the agent understand the full context better.

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 'id' parameter fully documented in the schema ('要删除的短网址ID' meaning short URL ID to delete). The description does not add any additional meaning or details beyond what the schema provides, such as format examples or constraints. Given the high schema coverage, a baseline score of 3 is appropriate as the schema handles the parameter semantics adequately.

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 specific action ('删除' meaning delete) and resource ('指定的短网址' meaning specified short URL), distinguishing it from sibling tools like create_short_url, batch_create_short_urls, get_url_info, and list_short_urls. It precisely communicates what the tool does without being vague or tautological.

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

Usage Guidelines4/5

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

The description provides clear context for usage by warning that deletion is irreversible ('删除后无法恢复'), implying this tool should be used cautiously and only when permanent removal is intended. However, it does not explicitly state when to use alternatives (e.g., for temporary deactivation or other operations), nor does it name specific sibling tools as alternatives, which prevents a perfect score.

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/muleiwu/dwz-mcp'

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