Skip to main content
Glama
andrewlwn77
by andrewlwn77

delete_record

Remove a specific record from a NocoDB table by providing the base ID, table name, and record ID.

Instructions

Delete a single record

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
base_idYesThe ID of the base/project
table_nameYesThe name of the table
record_idYesThe ID of the record to delete

Implementation Reference

  • The handler function that implements the core logic of the 'delete_record' tool. It invokes the NocoDBClient's deleteRecord method with the provided arguments and returns a success message.
    handler: async (
      client: NocoDBClient,
      args: {
        base_id: string;
        table_name: string;
        record_id: string;
      },
    ) => {
      await client.deleteRecord(args.base_id, args.table_name, args.record_id);
      return {
        message: "Record deleted successfully",
        record_id: args.record_id,
      };
    },
  • The input schema defining the required parameters (base_id, table_name, record_id) for the 'delete_record' tool.
    inputSchema: {
      type: "object",
      properties: {
        base_id: {
          type: "string",
          description: "The ID of the base/project",
        },
        table_name: {
          type: "string",
          description: "The name of the table",
        },
        record_id: {
          type: "string",
          description: "The ID of the record to delete",
        },
      },
      required: ["base_id", "table_name", "record_id"],
    },
  • src/index.ts:55-62 (registration)
    The 'recordTools' array (which includes the 'delete_record' tool) is imported and spread into 'allTools', which is registered with the MCP server's ListToolsRequestSchema and CallToolRequestSchema handlers.
    const allTools = [
      ...databaseTools,
      ...tableTools,
      ...recordTools,
      ...viewTools,
      ...queryTools,
      ...attachmentTools,
    ];
  • Supporting method in NocoDBClient that resolves the table ID, determines the primary key field, and makes the API call to delete the record.
    async deleteRecord(
      baseId: string,
      tableName: string,
      recordId: string,
    ): Promise<void> {
      // First get table ID from table name
      const tables = await this.listTables(baseId);
      const table = tables.find(
        (t) => t.table_name === tableName || t.title === tableName,
      );
      if (!table) {
        throw new NocoDBError(`Table ${tableName} not found`);
      }
    
      // Get the primary key field name (usually ID but can vary)
      const columns = await this.listColumns(table.id);
      const pkColumn =
        columns.find((col) => col.pk) ||
        columns.find((col) => col.title === "ID");
      const pkField = pkColumn?.title || "ID";
    
      await this.client.delete(`/api/v2/tables/${table.id}/records`, {
        data: { [pkField]: recordId },
      });
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Delete' implies a destructive operation, it doesn't specify whether deletion is permanent, requires specific permissions, triggers cascading effects, or provides confirmation. This is inadequate for a destructive tool with zero annotation coverage.

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 extremely concise with just four words, front-loading the essential action and resource. Every word earns its place with zero wasted verbiage.

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 operation with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after deletion, potential side effects, error conditions, or return values. The context demands more comprehensive disclosure than provided.

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 all three parameters (base_id, table_name, record_id) are documented in the schema. The description adds no additional parameter information beyond what's already in the structured schema, meeting the baseline expectation.

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 single record'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'delete_column' or 'delete_table', 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 like 'bulk_insert' for batch operations or 'update_record' for modifications instead of deletion. There's no mention of prerequisites, constraints, or typical use cases.

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/andrewlwn77/nocodb-mcp'

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