Skip to main content
Glama

Unregister Agent

unregister-agent

Remove an agent from active status in the MCP Agentic Framework to prevent receiving new messages and deactivate communication capabilities.

Instructions

Unregister an agent from the communication framework. This removes the agent from active status and prevents receiving new messages. Only unregister your own agent ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe unique identifier of the agent to unregister

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
successYesWhether the unregistration was successful

Implementation Reference

  • Main handler function for 'unregister-agent' tool. Orchestrates the unregistration process: gets agent details, unregisters the agent, checks if minimi agent left and updates write lock state accordingly, and returns a structured response.
    export async function unregisterAgent(id) {
      const startTime = Date.now();
      try {
        // Get agent details before unregistering
        const agent = await agentRegistry.getAgent(id);
        const agentName = agent ? agent.name : null;
        
        const result = await agentRegistry.unregisterAgent(id);
        
        // Check if minimi left and update lock state
        if (agentName === 'minimi' && result.success) {
          const minimiStillPresent = await writeLockManager.checkMinimiPresence();
          await writeLockManager.updateLockForMinimiPresence(minimiStillPresent);
        }
        
        const metadata = createMetadata(startTime, { tool: 'unregister-agent' });
        
        const message = result.success 
          ? `Agent '${id}' unregistered successfully`
          : `Agent '${id}' not found`;
        
        return structuredResponse(result, message, metadata);
      } catch (error) {
        if (error instanceof MCPError) {
          throw error;
        }
        throw Errors.internalError(error.message);
      }
    }
  • Schema definition for 'unregister-agent' tool. Defines input schema requiring agent ID parameter, and output schema with success boolean. Includes tool name, title, and description.
      name: 'unregister-agent',
      title: 'Unregister Agent',
      description: 'Unregister an agent from the communication framework. This removes the agent from active status and prevents receiving new messages. Only unregister your own agent ID.',
      inputSchema: {
        $schema: 'http://json-schema.org/draft-07/schema#',
        type: 'object',
        properties: {
          id: {
            type: 'string',
            description: 'The unique identifier of the agent to unregister',
            minLength: 1
          }
        },
        required: ['id'],
        additionalProperties: false
      },
      outputSchema: {
        $schema: 'http://json-schema.org/draft-07/schema#',
        type: 'object',
        properties: {
          success: {
            type: 'boolean',
            description: 'Whether the unregistration was successful'
          }
        },
        required: ['success'],
        additionalProperties: false
      }
    },
  • src/server.js:155-158 (registration)
    Registration point for 'unregister-agent' tool in the MCP server. Maps tool name to handler function in the CallToolRequestSchema request handler switch statement.
    case 'unregister-agent': {
      const { id } = args;
      return await unregisterAgent(id);
    }
  • Core helper function that performs the actual agent unregistration. Validates agent ID, acquires lock, deletes agent from storage, emits notification, and returns success status.
    const unregisterAgent = async (id) => {
      validateAgentId(id);
    
      return withLock(async () => {
        const agents = await loadAgents(storagePath);
        
        if (!agents[id]) {
          return { success: false };
        }
        
        delete agents[id];
        await saveAgents(storagePath, agents);
        
        // Emit notification if manager is available
        if (notificationManager) {
          await notificationManager.notifyAgentUnregistered(id);
        }
        
        return { success: true };
      });
    };
Behavior3/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. It discloses key behavioral traits: the tool performs a removal action ('unregister'), changes agent status ('removes from active status'), and has functional consequences ('prevents receiving new messages'). However, it lacks details on permissions, reversibility, or error conditions, which would be helpful 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 front-loaded with the core purpose in the first sentence, followed by critical usage guidance. Every sentence earns its place with no wasted words, making it highly efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation with no annotations) and the presence of an output schema (which handles return values), the description is mostly complete. It covers purpose, usage, and key effects, but could benefit from more behavioral details like permissions or side effects to fully compensate for the lack of annotations.

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%, so the schema already fully documents the 'id' parameter. The description adds no additional parameter semantics beyond what's in the schema, such as format examples or constraints like 'must be your own agent ID' (which is usage guidance, not parameter semantics). Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the specific action ('unregister'), the resource ('agent from the communication framework'), and the effect ('removes the agent from active status and prevents receiving new messages'). It distinguishes from siblings like 'register-agent' by specifying the opposite operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidance: 'Only unregister your own agent ID.' This clearly indicates when to use this tool (for self-unregistration) and implies when not to use it (for other agents), distinguishing it from potential alternatives like 'update-agent-status' for broader status changes.

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

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/Piotr1215/mcp-agentic-framework'

If you have feedback or need assistance with the MCP directory API, please join our Discord server