Skip to main content
Glama
muleiwu

DWZ Short URL MCP Server

by muleiwu

delete_short_url

Remove a specific short URL from the DWZ Short URL service. This action permanently deletes the link and cannot be undone.

Instructions

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

Input Schema

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

Implementation Reference

  • The MCP tool definition for 'delete_short_url', including handler function that calls the short link service and formats the 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(), }, }; })(); }, };
  • Registration of the deleteShortUrlTool along with other tools into the MCP server's tools 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} 个工具`); }
  • Joi schema definition for validating deleteShortUrl input parameters (used by the service).
    deleteShortUrl: Joi.object({ id: commonRules.id, }),
  • The ShortLinkService method that executes the HTTP DELETE request to the remote API to delete the short URL.
    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); } }

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