Skip to main content
Glama

deregister-service

Remove a service from Consul by its ID using this tool. Simplifies service deregistration to maintain clean and accurate service registries in the Consul MCP Server.

Instructions

Deregister a service from Consul

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoID of the service to deregister

Implementation Reference

  • Full handler implementation for 'deregister-service' tool, including Zod input schema and async execution logic that deregisters the service via consul.agent.service.deregister(id)
    server.tool(
      "deregister-service",
      "Deregister a service from Consul",
      {
        id: z.string().default("").describe("ID of the service to deregister"),
      },
      async ({ id }) => {
        try {
          await consul.agent.service.deregister(id);
          //if (!success) {
          //  return { content: [{ type: "text", text: `Failed to deregister service with ID: ${id}` }] };
          //}
          
          return { content: [{ type: "text", text: `Successfully deregistered service with ID: ${id}` }] };
        } catch (error) {
          console.error("Error deregistering service:", error);
          return { content: [{ type: "text", text: `Error deregistering service with ID: ${id}` }] };
        }
      }
    );
  • src/server.ts:40-40 (registration)
    Registration of agent services tools, including 'deregister-service', by calling registerAgentServices(server, consul)
    registerAgentServices(server, consul);
  • Zod schema for input parameters of deregister-service tool: requires 'id' as string
    {
      id: z.string().default("").describe("ID of the service to deregister"),
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. 'Deregister' implies a destructive mutation, but the description doesn't specify whether this action is reversible, what permissions are required, whether it affects related resources, or what happens on success/failure. 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 states exactly what the tool does with zero wasted words. It's appropriately sized for a simple tool with one parameter and gets straight to the point.

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 insufficient. It doesn't explain what happens after deregistration, whether there are side effects, what the response looks like, or any error conditions. Given the complexity of removing a service from a system like Consul, more context 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?

The schema has 100% description coverage, with the single parameter 'id' clearly documented in the schema itself. The description adds no additional parameter context beyond what's already in the structured schema, so it meets the baseline but doesn't provide extra value.

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 resource ('a service from Consul'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'destroy-session' or 'delete-kv' which also perform removal operations on different Consul resources, so it doesn't reach the highest score.

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 'destroy-session' and 'delete-kv' that also remove things, there's no indication whether this is for removing services specifically versus other Consul entities, nor any prerequisites or warnings about when not to use it.

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