Skip to main content
Glama
datastax

Astra DB MCP Server

Official

DeleteRecord

Remove a specific record from a collection in Astra DB by specifying the collection name and record ID using the MCP Server's tool for efficient data management.

Instructions

Delete a record from a collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionNameYesName of the collection containing the record
recordIdYesID of the record to delete

Implementation Reference

  • The main handler function that executes the deletion of a specific record from the given collection by ID using the database client.
    export async function DeleteRecord(params: {
      collectionName: string;
      recordId: string;
    }) {
      const { collectionName, recordId } = params;
    
      const collection = db.collection(collectionName);
      const result = await collection.deleteOne({ _id: recordId });
    
      if (result.deletedCount === 0) {
        throw new Error(
          `Record with ID '${recordId}' not found in collection '${collectionName}'`
        );
      }
    
      return {
        success: true,
        message: `Record '${recordId}' deleted successfully from collection '${collectionName}'`,
      };
    }
  • The JSON schema defining the input parameters for the DeleteRecord tool: collectionName and recordId.
    {
      name: "DeleteRecord",
      description: "Delete a record from a collection",
      inputSchema: {
        type: "object",
        properties: {
          collectionName: {
            type: "string",
            description: "Name of the collection containing the record",
          },
          recordId: {
            type: "string",
            description: "ID of the record to delete",
          },
        },
        required: ["collectionName", "recordId"],
      },
    },
  • index.ts:201-213 (registration)
    The switch case in the CallToolRequestSchema handler that registers and invokes the DeleteRecord tool during runtime.
    case "DeleteRecord":
      const deleteRecordResult = await DeleteRecord({
        collectionName: args.collectionName as string,
        recordId: args.recordId as string,
      });
      return {
        content: [
          {
            type: "text",
            text: deleteRecordResult.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. It states the destructive action ('Delete') but fails to mention critical details like whether deletion is permanent or reversible, what permissions are required, if there are rate limits, 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 directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly, though its brevity contributes to gaps in other dimensions.

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 complexity of a destructive operation with no annotations and no output schema, the description is insufficient. It lacks details on behavioral traits (e.g., permanence, error handling), usage context compared to siblings, and expected outcomes, making it incomplete for safe and effective tool invocation.

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%, with clear documentation for both parameters ('collectionName' and 'recordId'). The description adds no additional semantic context beyond what the schema provides, such as format examples or constraints, so it meets the baseline for high schema coverage without compensating 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 ('Delete') and target ('a record from a collection'), making the purpose immediately understandable. However, it doesn't distinguish this tool from its sibling 'BulkDeleteRecords', which handles multiple records, leaving room for improvement in sibling differentiation.

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 like 'BulkDeleteRecords' for multiple records or 'DeleteCollection' for entire collections. It lacks context about prerequisites, such as needing an existing collection and record ID, or any exclusions for its use.

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