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);
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions what information is returned (configuration and status) but doesn't describe important behaviors like whether this is a read-only operation, if it requires authentication, rate limits, pagination, or what happens if no domains exist. For a list operation with zero annotation coverage, this leaves significant gaps.

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 communicates the core purpose without any wasted words. It's appropriately sized for a simple list operation and front-loads the key information ('获取所有可用的域名列表'). Every word earns its place.

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

Completeness3/5

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

For a simple list operation with no parameters and no output schema, the description provides adequate but minimal information. It states what the tool does and what information it returns, but lacks behavioral context that would be helpful given the absence of annotations. Without an output schema, the description should ideally provide more detail about return format, but it only mentions '配置信息和状态' without specifics.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the schema already fully documents the parameter situation. The description appropriately doesn't waste space discussing non-existent parameters. A baseline of 4 is appropriate for zero-parameter tools where the schema handles everything.

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 ('获取所有可用的域名列表' - get all available domain list) and the resource ('域名' - domains), including what information is returned ('域名配置信息和状态' - domain configuration information and status). It distinguishes from siblings like list_short_urls by focusing on domains rather than URLs. However, it doesn't explicitly contrast with other domain-related tools (none in sibling list), so it's not a perfect 5.

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. There's no mention of prerequisites, timing considerations, or comparison with other tools. The agent must infer usage from the purpose alone, which is insufficient for optimal tool selection.

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