Skip to main content
Glama

get_batch_status

Retrieve the status of a batch operation (update, delete, import, or DartQL) using its batch operation ID.

Instructions

Retrieve status of a batch operation (update, delete, import, or dartql) by batch_operation_id. Operations are kept in memory for 1 hour.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
batch_operation_idYesBatch operation ID returned from batch_update_tasks, batch_delete_tasks, or import_tasks_csv

Implementation Reference

  • The main handler function `handleGetBatchStatus`. Validates that `batch_operation_id` is a non-empty string, retrieves the operation from the in-memory store via `getBatchOperation()`, and returns either `{found: false, message: ...}` or `{found: true, operation: ...}`.
    export async function handleGetBatchStatus(
      input: GetBatchStatusInput
    ): Promise<GetBatchStatusOutput> {
      // ============================================================================
      // Step 1: Validate input
      // ============================================================================
      if (!input || typeof input !== 'object') {
        throw new ValidationError('input is required and must be an object', 'input');
      }
    
      if (
        !input.batch_operation_id ||
        typeof input.batch_operation_id !== 'string' ||
        input.batch_operation_id.trim() === ''
      ) {
        throw new ValidationError(
          'batch_operation_id is required and must be a non-empty string',
          'batch_operation_id'
        );
      }
    
      // ============================================================================
      // Step 2: Retrieve operation from store
      // ============================================================================
      const operation = getBatchOperation(input.batch_operation_id);
    
      // ============================================================================
      // Step 3: Return result
      // ============================================================================
      if (!operation) {
        return {
          found: false,
          message: `Batch operation "${input.batch_operation_id}" not found. Operations are kept in memory for 1 hour after completion.`,
        };
      }
    
      return {
        found: true,
        operation,
      };
    }
  • Input schema `GetBatchStatusInput`: expects a required `batch_operation_id` string.
    export interface GetBatchStatusInput {
      batch_operation_id: string;
    }
  • Output schema `GetBatchStatusOutput`: `found` boolean, optional `operation` (BatchOperation), and optional `message` string.
    export interface GetBatchStatusOutput {
      found: boolean;
      operation?: BatchOperation;
      message?: string;
    }
  • The `BatchOperation` interface used in the output, containing operation state: id, type, status, progress, successful_ids, failed_items, timestamps.
    export interface BatchOperation {
      batch_operation_id: string;
      operation_type: 'update' | 'delete' | 'import' | 'dartql';
      status: 'running' | 'completed' | 'failed';
      progress: {
        completed: number;
        total: number;
        percent: number;
      };
      successful_ids: string[];
      failed_items: Array<{ id?: string; row_number?: number; error: string }>;
      started_at: string;
      completed_at?: string;
      execution_time_ms?: number;
  • src/index.ts:608-621 (registration)
    Tool registration in `ListToolsRequestSchema` handler: defines the `get_batch_status` tool with name, description, and inputSchema requiring `batch_operation_id`.
    {
      name: 'get_batch_status',
      description: 'Retrieve status of a batch operation (update, delete, import, or dartql) by batch_operation_id. Operations are kept in memory for 1 hour.',
      inputSchema: {
        type: 'object',
        properties: {
          batch_operation_id: {
            type: 'string',
            description: 'Batch operation ID returned from batch_update_tasks, batch_delete_tasks, or import_tasks_csv',
          },
        },
        required: ['batch_operation_id'],
      },
    },
  • src/index.ts:1088-1098 (registration)
    Tool call dispatch in `CallToolRequestSchema` handler: the `case 'get_batch_status'` block that calls `handleGetBatchStatus` and returns JSON-stringified result.
    case 'get_batch_status': {
      const result = await handleGetBatchStatus((args || {}) as any);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Helper function `getBatchOperation()`: looks up a `BatchOperation` by ID from the in-memory Map store.
    export function getBatchOperation(batchOperationId: string): BatchOperation | undefined {
      return batchOperations.get(batchOperationId);
    }
  • Discovery listing of `get_batch_status` in the `task-batch` tool group for user-facing help.
      name: 'get_batch_status',
      description: 'Get status of a long-running batch operation by batch_operation_id',
    },
Behavior4/5

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

No annotations are provided, so the description carries full burden. It discloses the important behavioral trait that operations are kept in memory for 1 hour, adding value beyond the schema.

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 concise sentences: first states purpose and required parameter, second adds a critical time constraint. 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 retrieval tool with one parameter and no output schema, the description is fairly complete. It includes the time limit, though it could mention the response format.

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?

The schema has 100% coverage for the single parameter, describing its origin. The description does not add additional meaning beyond what the schema already provides.

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 clearly states the verb 'Retrieve' and the resource 'status of a batch operation', distinguishing it from sibling tools like batch_update_tasks, batch_delete_tasks, and import_tasks_csv.

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 implies usage after batch operations by referencing the batch_operation_id returned from other tools, but does not explicitly state when not to use it or list 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/standardbeagle/dart-query'

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