Skip to main content
Glama

validate_formula

Read-onlyIdempotent

Check a formula expression for validity and determine its result type (text, number, etc.) before creating or updating a formula field in Airtable.

Instructions

Validate a formula expression before creating or updating a formula field. Returns whether the formula is valid and what result type it produces (text, number, etc). Use this before create/update to catch errors early.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appIdYesThe Airtable base/application ID
tableIdYesThe table ID where the formula will be used
formulaTextYesThe formula expression to validate
debugNoWhen true, include raw Airtable response in output for diagnostics

Implementation Reference

  • The MCP tool handler for 'validate_formula'. Receives appId, tableId, formulaText from the LLM, delegates to client.validateFormula(), and returns the result (valid + resultType or error).
    async validate_formula({ appId, tableId, formulaText, debug }) {
      const result = await client.validateFormula(appId, tableId, formulaText);
      return ok(result, result, debug);
    },
  • The tool definition / input schema for 'validate_formula'. Declares three required parameters (appId, tableId, formulaText) and an optional debug flag.
    {
      name: 'validate_formula',
      description: 'Validate a formula expression before creating or updating a formula field. Returns whether the formula is valid and what result type it produces (text, number, etc). Use this before create/update to catch errors early.',
      annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
      inputSchema: {
        type: 'object',
        properties: {
          appId: { type: 'string', description: 'The Airtable base/application ID' },
          tableId: { type: 'string', description: 'The table ID where the formula will be used' },
          formulaText: { type: 'string', description: 'The formula expression to validate' },
          debug: debugProp,
        },
        required: ['appId', 'tableId', 'formulaText'],
      },
    },
  • Tool registration in TOOL_CATEGORIES — tagged as 'read' category (read-only/inspection tool).
    validate_formula:       'read',
  • The AirtableClient method that executes the actual HTTP call to Airtable's internal API (POST /v0.3/table/{tableId}/getUnsavedColumnConfigResultType). Returns { valid: boolean, resultType: string|null } or { valid: false, error, message } on failure.
    async validateFormula(appId, tableId, formulaText) {
      assertAirtableId(appId, 'appId');
      assertAirtableId(tableId, 'tableId');
      const url = `https://airtable.com/v0.3/table/${tableId}/getUnsavedColumnConfigResultType`;
      const payload = {
        config: {
          default: null,
          type: 'formula',
          typeOptions: { formulaText },
        },
      };
    
      const res = await this.auth.postForm(url, this._mutationParams(payload, appId), appId);
      const data = await res.json().catch(() => null);
    
      if (!res.ok) {
        return {
          valid: false,
          error: data?.error?.type || `HTTP ${res.status}`,
          message: data?.error?.message || 'Formula validation failed',
        };
      }
    
      return {
        valid: data?.data?.pass === true,
        resultType: data?.data?.resultType || null,
      };
    }
  • Mirror registration in the VS Code extension's tool-profile config (must stay in sync with tool-config.js).
    validate_formula:          'read',
Behavior4/5

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

Annotations already declare readOnlyHint, destructiveHint, idempotentHint, and openWorldHint. The description adds that the tool returns whether the formula is valid and the result type, and that debug mode includes raw Airtable response. This supplements the structured fields well without contradiction.

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?

Two sentences, front-loaded with the purpose, and every clause adds value. No wasted words.

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?

For a simple validation tool with good annotations and no output schema, the description covers the core behavior and usage context. It could mention the exact return format but is sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has 100% description coverage, so baseline is 3. The description adds value by explaining the debug parameter's purpose ('include raw Airtable response for diagnostics'), which goes beyond the schema. This warrants a 4.

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?

The description states 'Validate a formula expression before creating or updating a formula field' which is a specific verb (validate) and resource (formula expression). It also mentions the return type (validity and result type), clearly distinguishing it from sibling tools like create_formula_field or update_formula_field.

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

Usage Guidelines4/5

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

The description explicitly says 'Use this before create/update to catch errors early', providing clear guidance on when to use this tool. It does not explicitly mention when not to use, but the context of siblings implies alternatives.

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