Skip to main content
Glama

List Ducks

list_ducks
Read-only

List all LLM providers and their status. Optionally perform health checks to verify each provider is operational.

Instructions

List all available LLM providers (ducks) and their status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
check_healthNoPerform health check on all providers

Implementation Reference

  • The main handler function for the list_ducks tool. It retrieves all providers, optionally checks their health, and formats a text response listing each duck with its status, type, model, endpoint details, and health info.
    export async function listDucksTool(
      providerManager: ProviderManager,
      healthMonitor: HealthMonitor,
      args: Record<string, unknown>
    ) {
      const { check_health = false } = args as {
        check_health?: boolean;
      };
    
      // Get all providers with their info
      const providers = providerManager.getAllProviders();
    
      // Perform health check if requested
      let healthStatus = new Map<string, ProviderHealth>();
      if (check_health) {
        const healthResults = await healthMonitor.performHealthChecks();
        healthStatus = new Map(healthResults.map((result) => [result.provider, result]));
      }
    
      // Build response
      let response = `${duckArt.panel}\n\n`;
      response += `Found ${providers.length} duck(s) in the pond:\n\n`;
    
      for (const provider of providers) {
        const health = healthStatus.get(provider.name);
        const statusEmoji = health?.healthy ? 'āœ…' : health === undefined ? 'ā“' : 'āŒ';
    
        const providerType = provider.info.type === 'cli' ? 'CLI' : 'HTTP';
        response += `${statusEmoji} **${provider.info.nickname}** (${provider.name}) [${providerType}]\n`;
        response += `   šŸ“ Model: ${provider.info.model}\n`;
        if (provider.info.type === 'cli') {
          response += `   šŸ–„ļø Command: ${provider.info.cliCommand || 'default'}\n`;
          response += `   šŸ”§ CLI Type: ${provider.info.cliType || 'unknown'}\n`;
        } else {
          response += `   šŸ”— Endpoint: ${provider.info.baseURL}\n`;
          response += `   šŸ”‘ API Key: ${provider.info.hasApiKey ? 'Configured' : 'Not required'}\n`;
        }
    
        if (health) {
          response += `   šŸ’“ Health: ${health.healthy ? 'Healthy' : 'Unhealthy'}`;
          if (health.latency) {
            response += ` (${health.latency}ms)`;
          }
          if (health.error) {
            response += `\n   āš ļø Error: ${health.error}`;
          }
          response += `\n   šŸ•’ Last check: ${health.lastCheck.toLocaleTimeString()}\n`;
        }
    
        response += '\n';
      }
    
      // Add summary
      const healthyCount = Array.from(healthStatus.values()).filter((h) => h.healthy).length;
      response += `\nšŸ“Š Summary: ${healthyCount}/${providers.length} ducks are healthy and ready!`;
    
      logger.info(`Listed ${providers.length} ducks, ${healthyCount} healthy`);
    
      return {
        content: [
          {
            type: 'text',
            text: response,
          },
        ],
      };
    }
  • Input schema for list_ducks: optional boolean check_health parameter with default false.
    inputSchema: {
      check_health: z
        .boolean()
        .default(false)
        .describe('Perform health check on all providers'),
    },
  • src/server.ts:341-370 (registration)
    Registration of the 'list_ducks' tool with the MCP server, including title, description, input schema, annotations, and the handler invocation.
    this.server.registerTool(
      'list_ducks',
      {
        title: 'List Ducks',
        description: 'List all available LLM providers (ducks) and their status',
        inputSchema: {
          check_health: z
            .boolean()
            .default(false)
            .describe('Perform health check on all providers'),
        },
        annotations: {
          readOnlyHint: true,
          openWorldHint: true,
        },
      },
      async (args) => {
        try {
          return this.toolResult(
            await listDucksTool(
              this.providerManager,
              this.healthMonitor,
              args as Record<string, unknown>
            )
          );
        } catch (error) {
          return this.toolErrorResult(error);
        }
      }
    );
  • The ProviderHealth interface used by list_ducks to type-check health status results.
    export interface ProviderHealth {
      provider: string;
      healthy: boolean;
      latency?: number;
      lastCheck: Date;
      error?: string;
    }
Behavior3/5

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

Annotations already declare readOnlyHint and openWorldHint. Description adds 'status' but no further behavioral traits like pagination or response format.

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?

Single sentence, front-loaded, no unnecessary words. Efficient.

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

Completeness5/5

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

For a simple list tool with one optional parameter, the description covers the core functionality adequately. No output schema needed.

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?

Schema coverage is 100% with one parameter well-described. Description does not add extra context beyond the schema.

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?

Description clearly states verb 'list' and resource 'LLM providers (ducks)' with status. Distinguishes from sibling tools like ask_duck, chat_with_duck, etc.

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

Usage Guidelines3/5

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

No explicit guidance on when to use this tool over siblings like list_models or get_usage_stats. Context is implied but not stated.

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/nesquikm/mcp-rubber-duck'

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