Skip to main content
Glama

list-catalog-services

Retrieve a complete list of services registered in the Consul MCP Server catalog to monitor and manage service discovery efficiently.

Instructions

List all services in the catalog

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Inline handler function for the 'list-catalog-services' tool. Fetches the list of services from the Consul catalog using `consul.catalog.service.list()`, formats them with their tags, and returns a formatted text response.
      async () => {
        try {
          const data = await consul.catalog.service.list();
          if (!data) {
            return { content: [{ type: "text", text: "Failed to retrieve catalog services list" }] };
          }
          
          // Format the services data
          const servicesText = Object.entries(data)
            .map(([name, tags]) => `${name}: ${(tags as string[]).join(", ") || "No tags"}`)
            .join("\n");
          
          return { content: [{ type: "text", text: `Catalog services:\n\n${servicesText}` }] };
        } catch (error) {
          console.error("Error listing catalog services:", error);
          return { content: [{ type: "text", text: "Error listing catalog services" }] };
        }
      }
    );
  • Direct registration of the 'list-catalog-services' tool using `server.tool()`, including description, empty input schema, and inline handler.
    server.tool(
      "list-catalog-services",
      "List all services in the catalog",
      {},
      async () => {
        try {
          const data = await consul.catalog.service.list();
          if (!data) {
            return { content: [{ type: "text", text: "Failed to retrieve catalog services list" }] };
          }
          
          // Format the services data
          const servicesText = Object.entries(data)
            .map(([name, tags]) => `${name}: ${(tags as string[]).join(", ") || "No tags"}`)
            .join("\n");
          
          return { content: [{ type: "text", text: `Catalog services:\n\n${servicesText}` }] };
        } catch (error) {
          console.error("Error listing catalog services:", error);
          return { content: [{ type: "text", text: "Error listing catalog services" }] };
        }
      }
    );
  • src/server.ts:39-39 (registration)
    High-level registration invocation of `registerCatalogServices` during server setup, which registers the 'list-catalog-services' tool among others.
    registerCatalogServices(server, consul);
  • Empty input schema (no parameters) for the 'list-catalog-services' tool.
    {},
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It doesn't mention whether this is a read-only operation, if it requires authentication, how results are formatted, or any rate limits. 'List' implies a read operation, but specifics are lacking.

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, clear sentence with no wasted words. It's front-loaded and efficiently communicates the core functionality.

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

Completeness2/5

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

For a tool with no annotations and no output schema, the description is too minimal. It doesn't explain what 'services' are in this context, how results are returned, or any behavioral constraints, leaving significant gaps for an AI agent.

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 zero parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, earning a high baseline score.

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 ('List') and resource ('all services in the catalog'), making the purpose immediately understandable. It doesn't distinguish from sibling tools like 'get-catalog-service' or 'get-services', which prevents a perfect score.

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?

No guidance is provided on when to use this tool versus alternatives like 'get-catalog-service' or 'get-services'. The description only states what it does, not when it's appropriate.

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

Related 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/kocierik/consul-mcp-server'

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