Skip to main content
Glama

deregister-health-check

Remove a health check from Consul by specifying its ID to maintain accurate service monitoring and system health management.

Instructions

Deregister a health check from Consul

Input Schema

NameRequiredDescriptionDefault
idNoID of the health check to deregister

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "id": { "default": "", "description": "ID of the health check to deregister", "type": "string" } }, "type": "object" }

Implementation Reference

  • The handler function executes the deregistration of a health check by calling consul.agent.check.deregister(id) and returns success or error messages.
    async ({ id }) => { try { const success = await consul.agent.check.deregister(id); if (!success) { return { content: [{ type: "text", text: `Failed to deregister health check with ID: ${id}` }] }; } return { content: [{ type: "text", text: `Successfully deregistered health check with ID: ${id}` }] }; } catch (error) { console.error("Error deregistering health check:", error); return { content: [{ type: "text", text: `Error deregistering health check with ID: ${id}` }] }; } }
  • Zod schema defining the input parameter 'id' for the tool.
    { id: z.string().default("").describe("ID of the health check to deregister"), },
  • McpServer.tool registration call that defines and registers the deregister-health-check tool with its schema and handler.
    server.tool( "deregister-health-check", "Deregister a health check from Consul", { id: z.string().default("").describe("ID of the health check to deregister"), }, async ({ id }) => { try { const success = await consul.agent.check.deregister(id); if (!success) { return { content: [{ type: "text", text: `Failed to deregister health check with ID: ${id}` }] }; } return { content: [{ type: "text", text: `Successfully deregistered health check with ID: ${id}` }] }; } catch (error) { console.error("Error deregistering health check:", error); return { content: [{ type: "text", text: `Error deregistering health check with ID: ${id}` }] }; } } );
  • src/server.ts:37-37 (registration)
    Invocation of registerHealthChecks function which includes the registration of the deregister-health-check tool.
    registerHealthChecks(server, consul);

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