Skip to main content
Glama
andrewlwn77
by andrewlwn77

bulk_insert

Insert multiple records into a NocoDB table at once to efficiently manage database entries and perform bulk data operations.

Instructions

Insert multiple records into a table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
base_idYesThe ID of the base/project
table_nameYesThe name of the table
recordsYesArray of records to insert

Implementation Reference

  • The handler function that executes the bulk_insert tool logic by calling the NocoDB client's bulkInsert method.
    handler: async (
      client: NocoDBClient,
      args: {
        base_id: string;
        table_name: string;
        records: any[];
      },
    ) => {
      const records = await client.bulkInsert(args.base_id, args.table_name, {
        records: args.records,
      });
      return {
        records,
        count: records.length,
        message: `${records.length} records inserted successfully`,
      };
    },
  • Input schema defining the parameters for the bulk_insert 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",
        },
        records: {
          type: "array",
          description: "Array of records to insert",
          items: {
            type: "object",
            additionalProperties: true,
          },
        },
      },
      required: ["base_id", "table_name", "records"],
    },
  • The bulk_insert tool definition and registration within the recordTools array.
    {
      name: "bulk_insert",
      description: "Insert multiple records into a table",
      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",
          },
          records: {
            type: "array",
            description: "Array of records to insert",
            items: {
              type: "object",
              additionalProperties: true,
            },
          },
        },
        required: ["base_id", "table_name", "records"],
      },
      handler: async (
        client: NocoDBClient,
        args: {
          base_id: string;
          table_name: string;
          records: any[];
        },
      ) => {
        const records = await client.bulkInsert(args.base_id, args.table_name, {
          records: args.records,
        });
        return {
          records,
          count: records.length,
          message: `${records.length} records inserted successfully`,
        };
      },
    },
  • src/index.ts:55-62 (registration)
    Top-level registration where recordTools (including bulk_insert) is combined into allTools for MCP server.
    const allTools = [
      ...databaseTools,
      ...tableTools,
      ...recordTools,
      ...viewTools,
      ...queryTools,
      ...attachmentTools,
    ];
  • Supporting bulkInsert method in NocoDBClient used by the tool handler.
    async bulkInsert(
      baseId: string,
      tableName: string,
      options: BulkInsertOptions,
    ): Promise<NocoDBRecord[]> {
      // 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`);
      }
    
      const response = await this.client.post(
        `/api/v2/tables/${table.id}/records`,
        options.records,
      );
      return response.data;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action without disclosing critical behavioral traits. It doesn't mention whether this is an atomic operation, what happens on partial failures, rate limits, authentication needs, or return values. For a mutation tool with zero annotation coverage, this is a significant gap.

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 with zero waste. It's appropriately sized and front-loaded, clearly stating the core purpose without unnecessary elaboration.

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 mutation tool with no annotations, no output schema, and incomplete behavioral disclosure, the description is inadequate. It should explain more about the operation's behavior, error handling, and what to expect in return, especially since it handles multiple records.

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 (base_id, table_name, records). The description adds no additional meaning beyond what the schema provides, such as format examples or constraints. Baseline 3 is appropriate when schema does the heavy lifting.

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 ('Insert multiple records') and target ('into a table'), which is specific and distinguishes it from single-record operations like 'insert_record'. However, it doesn't explicitly differentiate from other bulk operations that might exist, though none are listed among siblings.

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 'insert_record' (for single records) or other bulk operations. It lacks context about prerequisites, performance considerations, or error handling for batch inserts.

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