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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/consulTools.ts:640-654 (registration)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" }] }; } } );