Skip to main content
Glama
andrewlwn77
by andrewlwn77

create_view

Create a new view for a NocoDB table to display data in different formats like grid, gallery, form, kanban, or calendar.

Instructions

Create a new view for a table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_idYesThe ID of the table
titleYesTitle of the new view
typeNoType of view (1=Grid, 2=Gallery, 3=Form, 4=Kanban, 5=Calendar)

Implementation Reference

  • Executes the create_view tool by calling the NocoDBClient's createView method and formatting the response.
    handler: async (
      client: NocoDBClient,
      args: {
        table_id: string;
        title: string;
        type?: number;
      },
    ) => {
      const view = await client.createView(
        args.table_id,
        args.title,
        args.type || 1,
      );
      return {
        view: {
          id: view.id,
          title: view.title,
          type: view.type,
          fk_model_id: view.fk_model_id,
          created_at: view.created_at,
          updated_at: view.updated_at,
        },
        message: `View '${view.title}' created successfully`,
      };
    },
  • Defines the input schema for the create_view tool, including required table_id and title, optional type.
    inputSchema: {
      type: "object",
      properties: {
        table_id: {
          type: "string",
          description: "The ID of the table",
        },
        title: {
          type: "string",
          description: "Title of the new view",
        },
        type: {
          type: "number",
          description:
            "Type of view (1=Grid, 2=Gallery, 3=Form, 4=Kanban, 5=Calendar)",
          default: 1,
        },
      },
      required: ["table_id", "title"],
    },
  • src/index.ts:55-62 (registration)
    Includes the viewTools (containing create_view) in the allTools array registered with the MCP server.
    const allTools = [
      ...databaseTools,
      ...tableTools,
      ...recordTools,
      ...viewTools,
      ...queryTools,
      ...attachmentTools,
    ];
  • NocoDBClient method invoked by the tool handler to perform the HTTP POST request creating the view.
    async createView(
      tableId: string,
      title: string,
      type: number = 1,
    ): Promise<NocoDBView> {
      const response = await this.client.post(
        `/api/v2/meta/tables/${tableId}/views`,
        {
          title,
          type,
        },
      );
      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 the full burden of behavioral disclosure. It states 'Create a new view' which implies a write/mutation operation, but doesn't disclose any behavioral traits such as permissions required, whether the operation is idempotent, what happens on failure, or the format of the response. 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 with zero wasted words. It's front-loaded with the core purpose ('Create a new view for a table'), making it immediately scannable and easy to understand 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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., the new view's ID or properties), error conditions, or side effects. Given the complexity of creating a view and the lack of structured data, more context is needed for effective use.

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 fully documents all three parameters (table_id, title, type with default and enum-like values). The description adds no additional parameter semantics beyond what's in the schema, such as explaining view types in more detail or providing examples. This 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 'Create a new view for a table' clearly states the action (create) and resource (view for a table), making the purpose immediately understandable. It distinguishes from siblings like 'create_table' by specifying 'view' rather than 'table', though it doesn't explicitly contrast with other view-related tools like 'list_views' or 'get_view_data'.

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 an existing table), exclusions (e.g., not for modifying existing views), or when to choose other tools like 'list_views' to check existing views first. Usage is implied but not explicitly stated.

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