Skip to main content
Glama
andrewlwn77
by andrewlwn77

delete_column

Remove a column from a NocoDB table by specifying its ID or name to restructure database tables and manage data organization.

Instructions

Delete a column from a table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_idYesThe ID of the table containing the column
column_idNoThe ID of the column to delete (provide either column_id or column_name)
column_nameNoThe name of the column to delete (provide either column_id or column_name)

Implementation Reference

  • The main handler function for the 'delete_column' tool. It resolves the column ID from name if necessary by listing columns, then calls the NocoDB client to delete the column.
    handler: async (
      client: NocoDBClient,
      args: {
        table_id: string;
        column_id?: string;
        column_name?: string;
      },
    ) => {
      if (!args.column_id && !args.column_name) {
        throw new Error("Either column_id or column_name must be provided");
      }
    
      let columnId = args.column_id;
    
      // If column_name is provided, find the column ID
      if (!columnId && args.column_name) {
        const columns = await client.listColumns(args.table_id);
        const column = columns.find(
          (col) =>
            col.column_name === args.column_name ||
            col.title === args.column_name,
        );
    
        if (!column) {
          throw new Error(`Column '${args.column_name}' not found in table`);
        }
    
        columnId = column.id;
      }
    
      await client.deleteColumn(columnId!);
    
      return {
        message: `Column ${args.column_name || args.column_id} deleted successfully`,
        column_id: columnId,
      };
    },
  • The input schema defining the parameters for the delete_column tool: table_id (required), optional column_id or column_name.
    inputSchema: {
      type: "object",
      properties: {
        table_id: {
          type: "string",
          description: "The ID of the table containing the column",
        },
        column_id: {
          type: "string",
          description:
            "The ID of the column to delete (provide either column_id or column_name)",
        },
        column_name: {
          type: "string",
          description:
            "The name of the column to delete (provide either column_id or column_name)",
        },
      },
      required: ["table_id"],
    },
  • src/index.ts:55-62 (registration)
    The delete_column tool is registered by including tableTools (which contains it) in the allTools array used by the MCP server for tool listing and execution.
    const allTools = [
      ...databaseTools,
      ...tableTools,
      ...recordTools,
      ...viewTools,
      ...queryTools,
      ...attachmentTools,
    ];
  • Helper method in NocoDBClient that performs the API call to delete a column, invoked by the tool handler.
    async deleteColumn(columnId: string): Promise<void> {
      await this.client.delete(`/api/v2/meta/columns/${columnId}`);
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Delete' implies a destructive mutation, but the description doesn't specify if this is irreversible, requires special permissions, affects dependent views/queries, or has rate limits. This is a significant gap 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 a single, efficient sentence that directly states the tool's function without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse quickly.

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 this is a destructive mutation tool with no annotations and no output schema, the description is inadequate. It lacks critical context such as what happens after deletion (e.g., data loss, error handling), permissions required, or behavioral constraints, leaving the agent under-informed for safe usage.

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 the schema already documents all three parameters (table_id, column_id, column_name) and their purposes. The description adds no additional parameter semantics beyond what the schema provides, meeting the baseline for high coverage but not enhancing understanding.

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 column from a table'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'delete_table' or 'delete_record' beyond the resource type, which prevents 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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing table access), exclusions (e.g., cannot delete primary key columns), or comparisons to siblings like 'delete_table' or 'delete_record', leaving the agent with minimal context for selection.

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