Skip to main content
Glama
kesslerio

Attio MCP Server

by kesslerio

batch-search

Read-onlyIdempotent

Search multiple queries simultaneously across Attio CRM resources like companies, people, records, and tasks to efficiently retrieve data in parallel operations.

Instructions

Perform batch search operations with multiple queries in parallel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results per query (default: 20)
offsetNoNumber of results to skip per query (default: 0)
queriesYesArray of search query strings
resource_typeYesResource type to search (companies, people, records, tasks, deals)

Implementation Reference

  • Core handler function for batch search operations, aliased as 'batch-search'. Performs validation and calls universalBatchSearch API.
    handler: async (
      params: BatchSearchParams
    ): Promise<UniversalBatchSearchResult[]> => {
      try {
        const sanitizedParams = validateUniversalToolParams(
          'records_search_batch',
          params
        );
    
        const { resource_type, queries, limit, offset } = sanitizedParams;
    
        if (!queries || !Array.isArray(queries) || queries.length === 0) {
          throw new Error('Queries array is required and must not be empty');
        }
    
        // Validate batch operation with comprehensive checks
        const searchValidation = validateBatchOperation({
          items: queries,
          operationType: 'search',
          resourceType: resource_type,
          checkPayload: false, // Queries don't need payload size check
        });
        if (!searchValidation.isValid) {
          throw new Error(searchValidation.error);
        }
    
        // Use optimized universal batch search API (Issue #471)
        return await universalBatchSearch(resource_type, queries, {
          limit,
          offset,
        });
      } catch (error: unknown) {
        throw ErrorService.createUniversalError(
          'records_search_batch',
          params.resource_type,
          error
        );
      }
    },
  • Input schema definition for the batch-search tool, defining parameters like resource_type, queries array, limit, and offset.
    export const batchSearchSchema = {
      type: 'object' as const,
      properties: {
        resource_type: {
          type: 'string' as const,
          enum: Object.values(UniversalResourceType),
          description:
            'Resource type to search (companies, people, records, tasks, deals)',
        },
        queries: {
          type: 'array' as const,
          items: { type: 'string' as const },
          description: 'Array of search query strings',
          minItems: 1,
        },
        limit: {
          type: 'number' as const,
          minimum: 1,
          maximum: 100,
          description: 'Maximum number of results per query (default: 20)',
        },
        offset: {
          type: 'number' as const,
          minimum: 0,
          description: 'Number of results to skip per query (default: 0)',
        },
      },
      required: ['resource_type' as const, 'queries' as const],
      additionalProperties: false,
      examples: [
        {
          resource_type: 'companies',
          queries: ['Acme', 'Globex'],
          limit: 10,
        },
      ],
    };
  • Tool alias registration mapping 'batch-search' to the canonical 'records_search_batch' tool.
    'batch-search': {
      target: 'records_search_batch',
      reason: 'Phase 1 search tool rename (#776)',
      since: SINCE_PHASE_1,
      removal: 'v1.x (TBD)',
    },
  • Registration of the 'records_search_batch' tool definition (target of batch-search alias) in universal tools.
    export const universalToolDefinitions = {
      // Ensure health-check is listed first alphabetically for best-guess scanners
      'aaa-health-check': healthCheckToolDefinition,
      'smithery-debug-config': smitheryDiagnosticsToolDefinition,
      ...coreOperationsToolDefinitions,
      ...advancedOperationsToolDefinitions,
      records_search_batch: batchSearchToolDefinition,
  • Registration of the 'records_search_batch' tool config/handler (target of batch-search alias) in universal tools.
    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 already declare readOnlyHint=true and idempotentHint=true, so the agent knows this is a safe, repeatable read operation. The description adds the 'parallel' execution context, which is useful behavioral information beyond annotations, but doesn't cover rate limits, performance characteristics, or error handling for failed queries.

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 that front-loads the core purpose ('Perform batch search operations') and adds key context ('with multiple queries in parallel'). There's zero wasted verbiage or redundancy.

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

Completeness3/5

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

For a search tool with good annotations (read-only, idempotent) and full schema coverage, the description is minimally adequate. However, without an output schema, it doesn't explain what results look like (e.g., array of result sets, error handling for partial failures), leaving gaps in understanding the tool's behavior.

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%, with all parameters well-documented in the schema itself. The description doesn't add any meaningful parameter semantics beyond what's already in the schema (e.g., it doesn't explain query format, result structure, or how parallel execution affects parameter interpretation). 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 ('Perform batch search operations') and resource ('multiple queries'), specifying parallel execution. It distinguishes from simple 'search' tools by emphasizing batch processing, though it doesn't explicitly differentiate from all sibling search tools like 'advanced-search' or 'search-by-content'.

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 'search', 'advanced-search', or other sibling search tools. It mentions parallel execution but doesn't specify scenarios where batch processing is preferred over individual searches or what trade-offs exist.

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