Skip to main content
Glama
tesla0225

MCP Create Server

by tesla0225

delete-server

Remove an MCP server by specifying its server ID. Use this tool to manage and free up resources by deleting servers no longer in use within the MCP Create Server environment.

Instructions

Delete a server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serverIdYesThe ID of the server

Implementation Reference

  • MCP tool handler for 'delete-server': validates input, delegates to ServerManager.deleteServer, and returns JSON result.
    case "delete-server": {
      const args = request.params
        .arguments as unknown as DeleteServerArgs;
      if (!args.serverId) {
        throw new Error("Missing required argument: serverId");
      }
    
      const result = await serverManager.deleteServer(args.serverId);
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(result),
          },
        ],
      };
    }
  • Core implementation in ServerManager: closes transport, kills process, removes from internal map, and deletes server directory.
    async deleteServer(
      serverId: string
    ): Promise<{ success: boolean; message: string }> {
      const server = this.servers.get(serverId);
      if (!server) {
        throw new Error(`Server ${serverId} not found`);
      }
    
      try {
        // Close the client connection
        await server.transport.close();
    
        // Kill server process
        server.process.kill();
    
        // Remove server from map
        this.servers.delete(serverId);
    
        // Delete server directory
        const serverDir = path.dirname(server.filePath);
        await fs.rm(serverDir, { recursive: true, force: true });
    
        return {
          success: true,
          message: `Server ${serverId} deleted`,
        };
      } catch (error) {
        console.error(`Error deleting server ${serverId}:`, error);
        throw error;
      }
    }
  • Tool object definition including name, description, and input schema for validation.
    const deleteServerTool: Tool = {
      name: "delete-server",
      description: "Delete a server",
      inputSchema: {
        type: "object",
        properties: {
          serverId: {
            type: "string",
            description: "The ID of the server",
          },
        },
        required: ["serverId"],
      },
    };
  • TypeScript type definition for tool arguments.
    interface DeleteServerArgs {
      serverId: string;
    }
  • index.ts:1011-1022 (registration)
    Registers the delete-server tool (via deleteServerTool) in the ListToolsRequest handler for discovery.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      console.error("Received ListToolsRequest");
      return {
        tools: [
          createServerFromTemplateTool,
          executeToolTool,
          getServerToolsTool,
          deleteServerTool,
          listServersTool,
        ],
      };
    });
Behavior1/5

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

With no annotations provided, the description carries full burden but only states the action ('delete') without disclosing critical behavioral traits. It doesn't mention if deletion is permanent, requires specific permissions, has side effects (e.g., data loss), rate limits, or what happens on success/failure. This is inadequate for a destructive operation.

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 ('Delete a server') that is front-loaded and wastes no words. It directly conveys the core action without unnecessary elaboration, making it highly concise and well-structured.

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?

Given the tool's destructive nature, lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral risks, return values, or error handling, leaving significant gaps for an AI agent to understand the tool's full context and implications.

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 input schema has 100% description coverage, with 'serverId' clearly documented as 'The ID of the server'. The description adds no parameter-specific information beyond what the schema provides, so it meets the baseline of 3 where schema does the heavy lifting.

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 'Delete a server' clearly states the action (delete) and resource (server), making the purpose immediately understandable. It distinguishes from siblings like 'create-server-from-template' (creation) and 'list-servers' (listing), but doesn't specify what type of server or deletion scope, keeping it from a perfect 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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., server must exist), exclusions (e.g., cannot delete if active), or sibling tools like 'execute-tool' that might offer alternative deletion methods. The description alone offers no usage context.

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/tesla0225/mcp-create'

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