Skip to main content
Glama

get-agent-members

Retrieve agent members from the Consul MCP Server to monitor and manage cluster participants effectively.

Instructions

Get agent members

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'get-agent-members' tool. Calls consul.agent.members() to retrieve agent members and formats the response.
    server.tool(
      "get-agent-members",
      "Get agent members",
      {},
      async () => {
        try {
          // @ts-ignore - The Consul type definitions are incomplete
          const members = await consul.agent.members() as AgentMember[];
          if (!members || members.length === 0) {
            return { content: [{ type: "text", text: "No agent members found" }] };
          }
          const membersText = members.map(member => 
            `Name: ${member.Name}, Address: ${member.Address}, Status: ${member.Status}`
          ).join("\n");
          return { content: [{ type: "text", text: `Agent Members:\n\n${membersText}` }] };
        } catch (error) {
          console.error("Error getting agent members:", error);
          return { content: [{ type: "text", text: "Error getting agent members" }] };
        }
      }
    );
  • Registration of the 'get-agent-members' tool using server.tool, including empty input schema and handler.
    server.tool(
      "get-agent-members",
      "Get agent members",
      {},
      async () => {
        try {
          // @ts-ignore - The Consul type definitions are incomplete
          const members = await consul.agent.members() as AgentMember[];
          if (!members || members.length === 0) {
            return { content: [{ type: "text", text: "No agent members found" }] };
          }
          const membersText = members.map(member => 
            `Name: ${member.Name}, Address: ${member.Address}, Status: ${member.Status}`
          ).join("\n");
          return { content: [{ type: "text", text: `Agent Members:\n\n${membersText}` }] };
        } catch (error) {
          console.error("Error getting agent members:", error);
          return { content: [{ type: "text", text: "Error getting agent members" }] };
        }
      }
    );
  • Type definition (schema) for AgentMember used in the get-agent-members tool response handling.
    interface AgentMember {
      Name: string;
      Address: string;
      Port: number;
      Tags: Record<string, string>;
      Status: number;
      ProtocolMin: number;
      ProtocolMax: number;
      ProtocolCur: number;
      DelegateMin: number;
      DelegateMax: number;
      DelegateCur: number;
    }
Behavior2/5

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

With no annotations, the description carries full burden but only states the action without behavioral details. It does not disclose whether this is a read-only operation, its permissions, rate limits, or output format, leaving significant gaps in understanding how the tool behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with 'Get agent members', a single phrase that directly states the purpose. It is front-loaded and wastes no words, though it may be overly terse, lacking necessary elaboration for clarity.

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 no annotations, no output schema, and a simple tool with 0 parameters, the description is incomplete. It fails to explain what 'agent members' are, the return format, or any behavioral context, making it inadequate for effective use despite low complexity.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description does not add parameter semantics, but this is acceptable as there are no parameters to describe, aligning with the baseline for zero parameters.

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

Purpose2/5

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

The description 'Get agent members' restates the tool name with minimal elaboration, making it tautological. It specifies the verb 'get' and resource 'agent members' but lacks detail on what 'agent members' are or the scope of retrieval, offering only basic purpose without differentiation from siblings.

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. The description does not mention context, prerequisites, or exclusions, leaving usage unclear compared to siblings like 'get-agent-self' or 'get-peers', which might overlap in functionality.

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