Skip to main content
Glama

get_table_schema

Read-onlyIdempotent

Retrieve the complete schema of an Airtable table, including all fields and views, by providing the base ID and table ID or name.

Instructions

Get the full schema for a single table including all fields and views.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appIdYesThe Airtable base/application ID
tableIdOrNameYesThe table ID (e.g. "tblXXX") or exact table name
debugNoWhen true, include raw Airtable response in output for diagnostics

Implementation Reference

  • The handler function for the get_table_schema tool. It resolves the table by ID or name using client.resolveTable(), then returns a summary with id, name, fields (with id, name, type, typeOptions), and views (with id, name, type).
    async get_table_schema({ appId, tableIdOrName, debug }) {
      const table = await client.resolveTable(appId, tableIdOrName);
      const summary = {
        id: table.id,
        name: table.name,
        fields: (table.columns || table.fields || []).map(f => ({
          id: f.id,
          name: f.name,
          type: f.type,
          typeOptions: f.typeOptions,
        })),
        views: (table.views || []).map(v => ({ id: v.id, name: v.name, type: v.type })),
      };
      return ok(summary, table, debug);
    },
  • The input schema definition for the get_table_schema tool, specifying required parameters 'appId' (base ID) and 'tableIdOrName' (table ID or exact name), optional 'debug' flag, and read-only annotations.
      name: 'get_table_schema',
      description: 'Get the full schema for a single table including all fields and views.',
      annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
      inputSchema: {
        type: 'object',
        properties: {
          appId: { type: 'string', description: 'The Airtable base/application ID' },
          tableIdOrName: { type: 'string', description: 'The table ID (e.g. "tblXXX") or exact table name' },
          debug: debugProp,
        },
        required: ['appId', 'tableIdOrName'],
      },
    },
  • Registration of get_table_schema in the TOOL_CATEGORIES map as a 'read' category tool in the MCP server's tool configuration.
    get_table_schema:       'read',
  • Registration of get_table_schema in the extension's mirror of TOOL_CATEGORIES for VS Code tool profile management.
    get_table_schema:          'read',
  • The client.resolveTable() helper method used by the handler. It fetches application data via getApplicationData() and resolves a table by ID or name (with ambiguity detection for duplicate names).
    async resolveTable(appId, tableIdOrName) {
      const data = await this.getApplicationData(appId);
      const tables = data?.data?.tableSchemas || data?.data?.tables || [];
    
      // Exact ID match is always unambiguous.
      const byId = tables.find(t => t.id === tableIdOrName);
      if (byId) return byId;
    
      // Name lookup: collect all matches and reject ambiguous results instead
      // of silently returning the first one.
      const byName = tables.filter(t => t.name === tableIdOrName);
      if (byName.length === 1) return byName[0];
      if (byName.length > 1) {
        const matches = byName.map(t => `${t.name} (${t.id})`).join(', ');
        throw new Error(
          `Ambiguous table name "${tableIdOrName}" \u2014 ${byName.length} tables share this name: ${matches}. ` +
          `Use the table ID to disambiguate.`
        );
      }
    
      const available = tables.map(t => `${t.name} (${t.id})`).join(', ');
      throw new Error(`Table "${tableIdOrName}" not found. Available: ${available}`);
    }
Behavior3/5

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

Annotations already provide readOnlyHint=true, destructiveHint=false, idempotentHint=true, which the description does not contradict. The description adds that it returns a comprehensive schema, but does not disclose error behavior or edge cases. With annotations covering safety, the description provides some additional context.

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?

Single, front-loaded sentence clearly states purpose with no wasted words. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given full schema coverage and comprehensive annotations, the description adequately conveys the tool's purpose. However, it lacks explicit details about the output format (e.g., properties of fields/views), which would improve completeness since no output schema is 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?

Input schema covers all three parameters with descriptions (100% coverage). The tool description does not add meaning or usage details beyond what the schema provides, so baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool retrieves the full schema of a single table, including all fields and views. This is specific and distinct from sibling tools like get_base_schema (for all tables) and list_fields/list_views (which are subsets).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Description implies usage when a complete table schema is needed, but does not explicitly mention alternatives like list_fields or list_views, nor when not to use this tool. Lacks comparative guidance.

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/Automations-Project/VSCode-Airtable-Formula'

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