Skip to main content
Glama
wrediam

Better Qdrant MCP Server

delete_collection

Remove a specific collection from the Qdrant vector database to manage storage and optimize semantic search operations effectively.

Instructions

Delete a Qdrant collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionYesName of the collection to delete

Implementation Reference

  • The primary handler for the 'delete_collection' tool. It invokes the Qdrant service to delete the specified collection and returns a formatted success or error response.
    private async handleDeleteCollection(args: DeleteCollectionArgs) {
      try {
        // Delete the collection
        await this.qdrantService.deleteCollection(args.collection);
        
        return {
          content: [
            {
              type: 'text',
              text: `Successfully deleted collection: ${args.collection}`,
            },
          ],
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        return {
          content: [
            {
              type: 'text',
              text: `Error deleting collection: ${errorMessage}`,
            },
          ],
          isError: true,
        };
      }
    }
  • TypeScript interface defining the input arguments for the delete_collection tool.
    interface DeleteCollectionArgs {
      collection: string;
    }
  • src/index.ts:175-188 (registration)
    Tool registration in the MCP server's list of tools, including name, description, and JSON input schema.
    {
      name: 'delete_collection',
      description: 'Delete a Qdrant collection',
      inputSchema: {
        type: 'object',
        properties: {
          collection: {
            type: 'string',
            description: 'Name of the collection to delete',
          },
        },
        required: ['collection'],
      },
    },
  • Runtime type guard/validator for DeleteCollectionArgs input parameters.
    private isDeleteCollectionArgs(args: unknown): args is DeleteCollectionArgs {
      if (!args || typeof args !== 'object') return false;
      const a = args as Record<string, unknown>;
      return typeof a.collection === 'string';
    }
  • Core implementation in QdrantService that performs the HTTP DELETE request to remove the specified collection from the Qdrant server.
    async deleteCollection(name: string): Promise<void> {
      try {
        console.log('Attempting to delete Qdrant collection using direct fetch...');
        
        // Use direct fetch instead of the client
        const deleteUrl = `${this.url}/collections/${name}`;
        console.log(`Fetching from: ${deleteUrl}`);
        
        const response = await fetch(deleteUrl, {
          method: 'DELETE',
          headers: {
            'Content-Type': 'application/json',
            ...(this.apiKey ? { 'api-key': this.apiKey } : {})
          },
          // @ts-ignore - node-fetch supports timeout
          timeout: 5000 // 5 second timeout
        });
        
        if (!response.ok) {
          throw new Error(`HTTP error! Status: ${response.status}`);
        }
        
        const data = await response.json();
        console.log('Successfully deleted collection:', data);
      } catch (error) {
        console.error('Error in deleteCollection:', error);
        if (error instanceof Error) {
          console.error(`${error.name}: ${error.message}`);
          console.error('Stack:', error.stack);
        }
        throw error;
      }
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool deletes a collection, implying a destructive mutation, but does not elaborate on critical aspects such as irreversibility, permissions required, error handling, or side effects (e.g., data loss). This leaves significant gaps for a tool with clear destructive intent.

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, direct sentence with zero wasted words, making it highly concise and front-loaded. It immediately communicates the core action without unnecessary elaboration, which is efficient for an AI agent.

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 insufficiently complete. It fails to address key contextual elements like irreversibility, error cases, or what happens post-deletion, which are critical for safe and informed usage by an agent.

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 description coverage is 100%, with the single parameter 'collection' clearly documented in the schema. The description does not add any additional meaning or context beyond what the schema provides (e.g., format examples or constraints), so it meets the baseline for adequate but not enhanced parameter semantics.

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 ('Delete') and resource ('a Qdrant collection'), making the purpose immediately understandable. However, it does not differentiate this tool from its siblings (like 'list_collections' or 'add_documents'), which would require mentioning it's a destructive operation versus read-only alternatives.

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. It does not mention prerequisites (e.g., that the collection must exist), exclusions, or refer to sibling tools like 'list_collections' for checking before deletion, leaving the agent with minimal context for decision-making.

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/wrediam/better-qdrant-mcp-server'

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