Skip to main content
Glama

get-leader

Retrieve the current leader node in the Consul MCP Server to monitor or manage cluster leadership and ensure system consistency.

Instructions

Get the current leader

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'get-leader' tool, including its inline handler function that retrieves the current Consul leader using consul.status.leader().
    server.tool(
      "get-leader",
      "Get the current leader",
      {},
      async () => {
        try {
          // @ts-ignore - The Consul type definitions are incomplete
          const leader = await consul.status.leader();
          return { content: [{ type: "text", text: `Current leader: ${leader}` }] };
        } catch (error) {
          console.error("Error getting leader:", error);
          return { content: [{ type: "text", text: "Error getting leader" }] };
        }
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Get' implies a read operation, but doesn't clarify if this is a safe, idempotent query or has side effects like caching. It lacks details on error conditions, rate limits, authentication needs, or what 'leader' entails (e.g., elected node, primary instance). For a tool with zero annotation coverage, this is a significant gap in transparency.

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 extremely concise at three words ('Get the current leader'), with no wasted language. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place by conveying the essential purpose without redundancy or fluff.

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 for effective tool use. It doesn't explain what 'leader' means in this context (e.g., from the sibling tools, it might relate to Consul or a similar system), what data is returned, or any behavioral nuances. For a tool that likely returns critical system state information, more context is needed to guide the agent properly.

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, meaning no parameters are documented in the schema. The description doesn't mention any parameters, which is appropriate here. Since there are no parameters to explain, the description doesn't need to compensate, and a baseline score of 4 is awarded for not introducing confusion or omissions regarding inputs.

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 the current leader' clearly states the verb ('Get') and resource ('current leader'), making the purpose understandable. However, it lacks specificity about what domain or system this leader belongs to (e.g., Consul cluster, agent pool), which would help distinguish it from potential siblings. It's not tautological but remains somewhat vague without context.

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. Given sibling tools like 'get-agent-self', 'get-peers', and 'get-services', it's unclear if this is for cluster leadership, service discovery, or another context. There's no mention of prerequisites, dependencies, or typical use cases, leaving the agent to infer usage from the name alone.

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