Skip to main content
Glama
muleiwu

DWZ Short URL MCP Server

by muleiwu

list_domains

Retrieve all available custom domains with configuration details and status for managing short URLs in the DWZ Short URL system.

Instructions

获取所有可用的域名列表,包括域名配置信息和状态。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function implementing the list_domains tool logic: logs the call, fetches domains from the service, formats the response with summary statistics, and returns structured result.
    handler: async function (args) { logger.info('MCP工具调用: list_domains', { args }); return ErrorHandler.asyncWrapper(async () => { // 调用服务层获取域名列表 const result = await defaultShortLinkService.listDomains(); // 格式化返回结果 return { success: true, message: '获取域名列表成功', data: { domains: result.list || [], summary: { total: result.list?.length || 0, active: result.list?.filter(d => d.is_active).length || 0, inactive: result.list?.filter(d => !d.is_active).length || 0, }, }, meta: { operation: 'list_domains', timestamp: new Date().toISOString(), }, }; })(); },
  • Input schema definition for list_domains tool, specifying no required parameters.
    inputSchema: { type: 'object', properties: {}, required: [], },
  • Registration of listDomainsTool in the MCP server's tools Map via the registerTools method.
    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} 个工具`); }
  • Supporting service method that performs the HTTP GET request to '/domains' endpoint and handles the API response for fetching domain list.
    async listDomains() { try { logger.info('获取域名列表'); // 发送请求 const response = await this.httpClient.get( getApiUrl('/domains') ); // 处理响应 const result = this.handleApiResponse(response, '获取域名列表'); logger.info('获取域名列表成功:', { count: result.list?.length || 0, }); 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