Skip to main content
Glama
kesslerio

Attio MCP Server

by kesslerio

batch-operations

Destructive

Perform bulk create, update, delete, get, and search operations on Attio CRM resources including companies, people, lists, records, and tasks in a single batch request.

Instructions

Perform bulk operations (create, update, delete, get, search)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results to return
offsetNoNumber of results to skip for pagination
operation_typeNoBatch operation type (legacy format)
operationsNoArray of operations to perform
record_idsNoRecord IDs for delete/get (legacy format)
recordsNoRecord data for create/update (legacy format)
resource_typeYesType of resource to operate on (companies, people, lists, records, tasks)

Implementation Reference

  • Core handler implementation for the records_batch tool (target of batch-operations alias). Handles input validation, routes to new operations array executor or legacy batch handler, and formats results.
    export const batchOperationsConfig: UniversalToolConfig<
      Record<string, unknown>,
      Record<string, unknown> | Record<string, unknown>[]
    > = {
      name: 'records_batch',
      handler: async (
        params: Record<string, unknown>
      ): Promise<Record<string, unknown> | Record<string, unknown>[]> => {
        try {
          const sanitizedParams = validateUniversalToolParams(
            'records_batch',
            params
          ) as JsonObject;
    
          const resourceType =
            sanitizedParams.resource_type as UniversalResourceType;
          const operations = sanitizedParams.operations as JsonObject[] | undefined;
    
          if (operations && operations.length > 0) {
            return executeOperationsArray(resourceType, operations);
          }
    
          return executeLegacyBatch({
            resourceType,
            params: sanitizedParams,
          });
        } catch (error: unknown) {
          const typedParams = params as Record<string, unknown>;
          throw ErrorService.createUniversalError(
            'records_batch',
            `${typedParams?.resource_type}:${typedParams?.operation_type}`,
            error
          );
        }
      },
      formatResult: (
        results: Record<string, unknown> | Record<string, unknown>[],
        ...args: unknown[]
      ) => {
        const operationType = args[0] as BatchOperationType | undefined;
        const resourceType = args[1] as UniversalResourceType | undefined;
        return formatBatchResult(
          results as
            | Record<string, unknown>
            | Record<string, unknown>[]
            | undefined,
          operationType,
          resourceType
        );
      },
    };
  • Input schema for batch-operations tool, defining properties for resource_type, operations array (modern format), and legacy operation_type/records/record_ids.
    export const batchOperationsSchema = {
      type: 'object' as const,
      properties: {
        resource_type: resourceTypeProperty,
        // New flexible format: operations array
        operations: {
          type: 'array' as const,
          items: {
            type: 'object' as const,
            properties: {
              operation: {
                type: 'string' as const,
                enum: ['create', 'update', 'delete'],
                description: 'Operation type for this specific operation',
              },
              record_data: {
                type: 'object' as const,
                additionalProperties: true,
                description: 'Record data for the operation',
              },
            },
            required: ['operation', 'record_data'],
            additionalProperties: false,
          },
          description: 'Array of operations to perform',
        },
        // Legacy format: single operation type applied to multiple records
        operation_type: {
          type: 'string' as const,
          enum: Object.values(BatchOperationType),
          description: 'Batch operation type (legacy format)',
        },
        records: {
          type: 'array' as const,
          items: { type: 'object' as const, additionalProperties: true },
          description: 'Record data for create/update (legacy format)',
        },
        record_ids: {
          type: 'array' as const,
          items: { type: 'string' as const },
          description: 'Record IDs for delete/get (legacy format)',
        },
        ...paginationProperties,
      },
      required: ['resource_type' as const],
      additionalProperties: false,
      examples: [
        {
          resource_type: 'companies',
          operation_type: BatchOperationType.CREATE,
          records: [
            { name: 'Example Ltd.', domain: 'example.com' },
            { name: 'Sample Inc.', domain: 'sample.io' },
          ],
        },
      ],
    };
  • Registration of batchOperationsConfig as 'records_batch' in advancedOperationsToolConfigs, which is merged into universalToolConfigs.
    export const advancedOperationsToolConfigs = {
      records_search_advanced: advancedSearchConfig,
      records_search_by_relationship: searchByRelationshipConfig,
      records_search_by_content: searchByContentConfig,
      records_search_by_timeframe: searchByTimeframeConfig,
      records_batch: batchOperationsConfig,
    };
  • Alias registration mapping the tool name 'batch-operations' to the canonical target 'records_batch'.
    'batch-operations': {
      target: 'records_batch',
      reason: 'Phase 1 search tool rename (#776)',
      since: SINCE_PHASE_1,
      removal: 'v1.x (TBD)',
    },
  • Final registration where advancedOperationsToolConfigs (including records_batch) is spread into the universalToolConfigs registry.
    export const universalToolConfigs = {
      // Ensure health-check is listed first alphabetically for best-guess scanners
      'aaa-health-check': healthCheckConfig,
      'smithery-debug-config': smitheryDiagnosticsConfig,
      ...coreOperationsToolConfigs,
      ...advancedOperationsToolConfigs,
      records_search_batch: batchSearchConfig,
      ...openAiToolConfigs,
    };
Behavior3/5

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

Annotations indicate readOnlyHint=false and destructiveHint=true, which the description doesn't contradict. The description mentions 'delete' as an operation type, aligning with the destructive hint. However, it adds minimal behavioral context beyond annotations—no information about rate limits, authentication needs, error handling, or what 'bulk' entails (e.g., atomicity, batch size limits). With annotations covering safety, the description adds some value but lacks depth.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that lists the operation types. It's front-loaded with the core purpose. However, it could be more structured by separating operation types or adding brief context, but it avoids unnecessary verbosity.

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 the tool's complexity (7 parameters, destructive operations, no output schema), the description is inadequate. It doesn't explain return values, error handling, or how batch results are formatted. With annotations providing basic safety info but no output schema, the description should offer more context to help the agent understand behavioral outcomes.

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 parameters are well-documented in the schema. The description adds no specific parameter semantics beyond implying operations like create/update/delete/get/search. It doesn't explain relationships between parameters (e.g., how 'operations' interacts with 'operation_type') or clarify legacy formats. Baseline 3 is appropriate as the schema handles most documentation.

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

Purpose3/5

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

The description states the tool performs bulk operations and lists the operation types (create, update, delete, get, search), which gives a general purpose. However, it's vague about what resources are operated on and doesn't distinguish this from sibling tools like batch-search, create-record, or update-record. The description lacks specificity about the scope or target of these operations.

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. With many sibling tools for individual operations (create-record, update-record, delete-record, search, etc.), there's no indication of when batch processing is preferred over single operations, what prerequisites exist, or any limitations. The agent must infer usage from the tool name alone.

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/kesslerio/attio-mcp-server'

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