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" }] }; } } );

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