Skip to main content
Glama
datastax

Astra DB MCP Server

Official

DeleteCollection

Remove a named collection from Astra DB using the MCP Server. Specify the collection name to delete it and manage database storage effectively.

Instructions

Delete a collection from the database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionNameYesName of the collection to delete

Implementation Reference

  • The main handler function that executes the deletion of a collection using the database's dropCollection method if available, returning success or error messages.
    export async function DeleteCollection(params: { collectionName: string }) {
      const { collectionName } = params;
    
      try {
        // Try to use dropCollection if available
        if (typeof db.dropCollection === 'function') {
          await db.dropCollection(collectionName);
        } else {
          // If dropCollection is not available, log a warning
          console.warn(`No dropCollection method available for collection '${collectionName}'`);
        }
    
        return {
          success: true,
          message: `Collection '${collectionName}' deleted successfully`,
        };
      } catch (error) {
        console.error(`Error deleting collection '${collectionName}':`, error);
        return {
          success: false,
          message: `Failed to delete collection '${collectionName}'`,
        };
      }
    }
  • Defines the input schema and metadata for the DeleteCollection tool, specifying that 'collectionName' is a required string parameter.
    {
      name: "DeleteCollection",
      description: "Delete a collection from the database",
      inputSchema: {
        type: "object",
        properties: {
          collectionName: {
            type: "string",
            description: "Name of the collection to delete",
          },
        },
        required: ["collectionName"],
      },
    },
  • index.ts:127-138 (registration)
    Registers the tool execution in the MCP server's CallToolRequestSchema handler by importing and calling DeleteCollection in the switch statement.
    case "DeleteCollection":
      const deleteResult = await DeleteCollection({
        collectionName: args.collectionName as string,
      });
      return {
        content: [
          {
            type: "text",
            text: deleteResult.message,
          },
        ],
      };
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. While 'Delete' implies a destructive mutation, the description doesn't specify whether this action is reversible, what permissions are required, what happens to dependent data, or if there are confirmation prompts. This leaves critical behavioral aspects undocumented 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, direct sentence that efficiently communicates the core action without unnecessary words. It's appropriately sized for a simple tool and front-loads the essential information.

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 tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens upon deletion (e.g., success/failure responses, error conditions), doesn't address safety considerations, and provides minimal context beyond the basic action. Given the complexity and risk of deletion operations, more completeness 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 input schema has 100% description coverage, with the single parameter 'collectionName' clearly documented. The description doesn't add any additional semantic context beyond what the schema provides (e.g., format requirements, naming conventions, or validation rules), so it meets the baseline for high schema coverage.

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 target resource ('a collection from the database'), making the purpose immediately understandable. However, it doesn't distinguish this tool from sibling tools like DeleteRecord or BulkDeleteRecords, which also perform deletion operations on different resources.

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 doesn't mention prerequisites (e.g., whether the collection must be empty), compare it to sibling deletion tools (DeleteRecord, BulkDeleteRecords), or specify when deletion is appropriate versus other operations like UpdateCollection.

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/datastax/astra-db-mcp'

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