Skip to main content
Glama

get-catalog-nodes

Retrieve catalog nodes from the Consul MCP Server to access and manage services, health checks, KV store, and other Consul functionalities efficiently.

Instructions

Get nodes from the catalog

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that lists all nodes from Consul catalog using consul.catalog.node.list(), formats them with formatCatalogNode, and returns formatted text.
    async () => {
      try {
        const data = await consul.catalog.node.list();
        if (!data || data.length === 0) {
          return { content: [{ type: "text", text: "No nodes found in the catalog" }] };
        }
        
        const nodesText = `Catalog nodes:\n\n${data.map(formatCatalogNode).join("\n")}`;
        return { content: [{ type: "text", text: nodesText }] };
      } catch (error) {
        console.error("Error getting catalog nodes:", error);
        return { content: [{ type: "text", text: "Error getting catalog nodes" }] };
      }
    }
  • Registers the 'get-catalog-nodes' tool on the McpServer with empty input schema and the handler function.
    server.tool(
      "get-catalog-nodes",
      "Get nodes from the catalog",
      {},
      async () => {
        try {
          const data = await consul.catalog.node.list();
          if (!data || data.length === 0) {
            return { content: [{ type: "text", text: "No nodes found in the catalog" }] };
          }
          
          const nodesText = `Catalog nodes:\n\n${data.map(formatCatalogNode).join("\n")}`;
          return { content: [{ type: "text", text: nodesText }] };
        } catch (error) {
          console.error("Error getting catalog nodes:", error);
          return { content: [{ type: "text", text: "Error getting catalog nodes" }] };
        }
      }
    );
  • Helper function used by the handler to format each CatalogNode into a readable string.
    export function formatCatalogNode(node: CatalogNode): string {
      return [
        `Node: ${node.Node || "Unknown"}`,
        `Address: ${node.Address || "Unknown"}`,
        `ServiceID: ${node.ServiceID || "Unknown"}`,
        `ServiceName: ${node.ServiceName || "Unknown"}`,
        `ServicePort: ${node.ServicePort || "Unknown"}`,
        `ServiceTags: ${node.ServiceTags?.join(", ") || "None"}`,
        "---",
      ].join("\n");
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the action ('Get') without detailing whether this is a read-only operation, if it requires permissions, what the output format is, or any rate limits. This is inadequate for a tool with zero annotation coverage.

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 with no wasted words. It's appropriately sized for a simple tool and front-loaded with the core action, making it easy to parse quickly.

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?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'nodes' are, the return format, or behavioral traits like safety or performance. For a tool in a server with many siblings, more context is needed to ensure proper usage.

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 fully documents the lack of inputs. The description doesn't need to add parameter details, and it correctly implies no parameters are required, aligning with the schema. Baseline is 4 for zero parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get nodes from the catalog' clearly states the action (get) and resource (nodes from catalog), but it's vague about what 'nodes' specifically are and doesn't differentiate from siblings like 'get-catalog-service' or 'list-catalog-services'. It provides basic purpose but lacks specificity.

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 such as 'get-catalog-service' or 'list-catalog-services'. The description offers no context about use cases, prerequisites, or exclusions, leaving the agent without direction on 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

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