get-agent-self
Retrieve self-details of the Consul agent, including its configuration and status, to monitor and manage Consul MCP Server operations effectively.
Instructions
Get agent self information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/consulTools.ts:751-760 (handler)Handler function that executes the 'get-agent-self' tool logic: calls consul.agent.self() and formats the response as JSON text.async () => { try { // @ts-ignore - The Consul type definitions are incomplete const self = await consul.agent.self(); return { content: [{ type: "text", text: `Agent Self:\n\n${JSON.stringify(self, null, 2)}` }] }; } catch (error) { console.error("Error getting agent self:", error); return { content: [{ type: "text", text: "Error getting agent self" }] }; } }
- src/tools/consulTools.ts:748-761 (registration)Registration of the 'get-agent-self' tool using server.tool(), including empty input schema {} and inline handler."get-agent-self", "Get agent self information", {}, async () => { try { // @ts-ignore - The Consul type definitions are incomplete const self = await consul.agent.self(); return { content: [{ type: "text", text: `Agent Self:\n\n${JSON.stringify(self, null, 2)}` }] }; } catch (error) { console.error("Error getting agent self:", error); return { content: [{ type: "text", text: "Error getting agent self" }] }; } } );