Skip to main content
Glama

get-catalog-service

Retrieve detailed information about a specific service from the catalog using Consul MCP Server, enabling efficient service discovery and management.

Instructions

Get information about a specific service from the catalog

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serviceNoName of the service to get information for

Implementation Reference

  • Full tool registration and handler implementation for 'get-catalog-service'. Includes input schema using Zod, fetches service nodes from Consul catalog, handles errors, and formats output with formatCatalogNode.
    server.tool(
      "get-catalog-service",
      "Get information about a specific service from the catalog",
      {
        service: z.string().default("").describe("Name of the service to get information for"),
      },
      async ({ service }) => {
        try {
          const data = await consul.catalog.service.nodes(service);
          if (!data || data.length === 0) {
            return { content: [{ type: "text", text: `No information found for service: ${service}` }] };
          }
          
          const serviceText = `Service information for ${service}:\n\n${data.map(formatCatalogNode).join("\n")}`;
          return { content: [{ type: "text", text: serviceText }] };
        } catch (error) {
          console.error("Error getting service information:", error);
          return { content: [{ type: "text", text: `Error getting information for service: ${service}` }] };
        }
      }
    );
  • Input schema for the get-catalog-service tool defining the 'service' parameter as a string.
    {
      service: z.string().default("").describe("Name of the service to get information for"),
    },
  • src/server.ts:39-39 (registration)
    Invocation of registerCatalogServices function which registers the get-catalog-service tool among others.
    registerCatalogServices(server, consul);
  • Utility function to format individual CatalogNode objects into readable strings, used in the tool's output formatting.
    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 full burden for behavioral disclosure. It states this is a read operation ('Get information'), but doesn't mention authentication requirements, rate limits, error handling, or what specific information is returned. For a tool with zero annotation coverage, this leaves significant behavioral 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 directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple lookup tool and front-loads the essential information.

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 single-parameter lookup tool with good schema coverage but no annotations or output schema, the description is minimally adequate. It states what the tool does but lacks important context about when to use it versus siblings, what information is returned, and behavioral constraints that would be helpful for an AI agent.

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 description coverage is 100%, with the single parameter 'service' clearly documented as 'Name of the service to get information for'. The description adds no additional parameter context beyond what the schema provides, which is adequate given the comprehensive schema documentation.

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 information') and resource ('specific service from the catalog'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get-services' or 'list-catalog-services', which appear to retrieve multiple services rather than a specific one.

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 like 'get-services' or 'list-catalog-services'. It mentions retrieving information for a 'specific service', but doesn't clarify prerequisites, error conditions, or appropriate contexts for selection among similar tools.

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