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

TableJSON Schema
NameRequiredDescriptionDefault
idNoID of the health check to deregister

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);
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. 'Deregister' implies a destructive mutation, but the description doesn't disclose behavioral traits like whether this requires specific permissions, if it's reversible, what happens to associated resources, or potential side effects. This leaves significant gaps for a mutation tool.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and wastes no space, making it easy to parse quickly.

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?

For a destructive mutation tool with no annotations and no output schema, the description is incomplete. It lacks crucial context like success/error responses, prerequisites (e.g., existing health check), or impact on system state. Given the complexity and absence of structured data, more detail is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'id' documented as 'ID of the health check to deregister'. The description doesn't add any meaning beyond this, such as format examples or where to find the ID. With high schema coverage, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Deregister') and target resource ('a health check from Consul'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'deregister-service' or 'register-health-check', which would require specifying what distinguishes health check deregistration from service deregistration or registration.

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. With siblings like 'deregister-service' and 'register-health-check', there's no indication of the specific context for health check deregistration, such as when a check is no longer needed versus removing a service entirely.

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