Skip to main content
Glama
Catter58

mcpBPMSoft

by Catter58

Пакетное удаление

bpm_batch_delete
DestructiveIdempotent

Delete multiple records by UUID in one OData v4 $batch request. Supports continue on error. Action is irreversible.

Instructions

Удаляет несколько записей по UUID в одном $batch (только OData v4). Поддерживает continue_on_error. Действие необратимо.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionYes
idsYesМассив UUID записей для удаления
continue_on_errorNoНе прерывать batch на первой ошибке

Implementation Reference

  • Handler function for bpm_batch_delete tool. Takes collection, ids array, and optional continue_on_error. Builds DELETE batch requests, executes via odataClient.executeBatch, and returns a summary of succeeded/failed operations.
    // bpm_batch_delete
    {
      const meta = getTool('bpm_batch_delete');
      server.registerTool(
        meta.name,
        {
          title: meta.title,
          description: meta.description,
          inputSchema: {
            collection: z.string(),
            ids: z.array(z.string()).describe('Массив UUID записей для удаления'),
            continue_on_error: z.boolean().optional().describe('Не прерывать batch на первой ошибке'),
          },
          annotations: meta.annotations,
        },
        async (params): Promise<CallToolResult> => {
          if (!services.initialized) return notInitialized();
          try {
            await services.authManager.ensureAuthenticated();
            if (params.ids.length === 0) {
              return { content: [{ type: 'text', text: 'Массив ID пуст. Нечего удалять.' }], isError: true };
            }
    
            const batchRequests = params.ids.map((id) => ({
              method: 'DELETE' as const,
              url: services.odataClient.buildRecordPath(params.collection, id),
            }));
    
            const result = await services.odataClient.executeBatch(batchRequests, params.continue_on_error ?? false);
    
            const succeeded = result.responses
              .map((r, i) => ({ index: i, ...r }))
              .filter((r) => r.status >= 200 && r.status < 300);
            const failed = result.responses
              .map((r, i) => ({ index: i, ...r }))
              .filter((r) => r.status >= 300);
    
            const lines = [
              `Пакетное удаление из ${params.collection}:`,
              `  Всего запросов: ${params.ids.length}`,
              `  Успешно удалено: ${succeeded.length}`,
              `  Ошибок: ${failed.length}`,
            ];
            if (failed.length > 0) {
              lines.push('', 'Ошибки:');
              failed.forEach((f) =>
                lines.push(`  #${f.index + 1} (id=${params.ids[f.index]}): HTTP ${f.status} — ${JSON.stringify(f.body).slice(0, 300)}`)
              );
            }
    
            return {
              content: [{ type: 'text', text: lines.join('\n') }],
              isError: failed.length > 0 && succeeded.length === 0,
              structuredContent: {
                collection: params.collection,
                total: params.ids.length,
                succeeded: succeeded.length,
                failed: failed.length,
                first_failed_index: failed.length > 0 ? failed[0].index : null,
              },
            };
          } catch (error) {
            const toolError = formatToolError(error, params.collection);
            return { content: [{ type: 'text', text: JSON.stringify(toolError, null, 2) }], isError: true };
          }
        }
      );
    }
  • Input schema for bpm_batch_delete: requires 'collection' (string), 'ids' (array of UUID strings), and optional 'continue_on_error' (boolean).
    inputSchema: {
      collection: z.string(),
      ids: z.array(z.string()).describe('Массив UUID записей для удаления'),
      continue_on_error: z.boolean().optional().describe('Не прерывать batch на первой ошибке'),
    },
  • Tool descriptor registration in the TOOLS array: defines name, title, description, annotations (destructive=true), blurb, and category (batch).
    {
      name: 'bpm_batch_delete',
      title: 'Пакетное удаление',
      description:
        'Удаляет несколько записей по UUID в одном $batch (только OData v4). Поддерживает continue_on_error. Действие необратимо.',
      annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: true },
      blurb: 'пакетное удаление (OData v4)',
      category: 'batch',
    },
  • src/index.ts:72-72 (registration)
    Registration call that wires registerBatchTools into the MCP server startup sequence.
    registerBatchTools(server, services);
Behavior5/5

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

Adds value beyond annotations by specifying OData v4 requirement, continue_on_error support, and irreversibility. No contradiction with annotations.

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 covering purpose, protocol, option, and consequence with no 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?

Lacks description of return value or batch response, but annotations (destructive, idempotent) compensate partially. Adequate but not complete.

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 coverage is 67% with descriptions for ids and continue_on_error. Description reiterates their purpose but adds no new parameter details beyond the schema.

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 it deletes multiple records by UUID using OData v4 batch, distinguishing it from sibling tools like bpm_delete_record (single) and bpm_delete_by_filter (by filter).

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?

Implies usage for batch deletion by UUID and warns of irreversibility, but does not explicitly state when to choose this over alternatives like bpm_delete_by_filter or single delete.

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/Catter58/mcpBPMSoft'

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