Skip to main content
Glama
OrionPotter

Meilisearch MCP Server

by OrionPotter

delete-tasks

Remove completed, failed, or canceled tasks from Meilisearch by filtering based on status, type, index, UID, or date to manage task history and optimize system performance.

Instructions

Delete tasks based on provided filters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusesNoStatuses of tasks to delete
typesNoTypes of tasks to delete
indexUidsNoUIDs of the indexes on which tasks to delete were performed
uidsNoUIDs of the tasks to delete
canceledByNoUIDs of the tasks that canceled tasks to delete
beforeUidNoDelete tasks whose uid is before this value
beforeStartedAtNoDelete tasks that started processing before this date (ISO 8601 format)
beforeFinishedAtNoDelete tasks that finished processing before this date (ISO 8601 format)

Implementation Reference

  • The handler function for the 'delete-tasks' tool. It builds a request body from the input parameters and performs a POST request to the Meilisearch '/tasks/delete' endpoint via apiClient, returning the JSON response or an error response.
    async ({ statuses, types, indexUids, uids, canceledBy, beforeUid, beforeStartedAt, beforeFinishedAt }) => {
      try {
        const body: Record<string, any> = {};
        if (statuses && statuses.length > 0) body.statuses = statuses;
        if (types && types.length > 0) body.types = types;
        if (indexUids && indexUids.length > 0) body.indexUids = indexUids;
        if (uids && uids.length > 0) body.uids = uids;
        if (canceledBy && canceledBy.length > 0) body.canceledBy = canceledBy;
        if (beforeUid !== undefined) body.beforeUid = beforeUid;
        if (beforeStartedAt) body.beforeStartedAt = beforeStartedAt;
        if (beforeFinishedAt) body.beforeFinishedAt = beforeFinishedAt;
        
        const response = await apiClient.post('/tasks/delete', body);
        return {
          content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }],
        };
      } catch (error) {
        return createErrorResponse(error);
      }
    }
  • Zod schema defining the input parameters for the 'delete-tasks' tool, including optional filters like statuses, types, indexUids, uids, etc.
    {
      statuses: z.array(z.enum(['succeeded', 'failed', 'canceled'])).optional().describe('Statuses of tasks to delete'),
      types: z.array(z.enum(['indexCreation', 'indexUpdate', 'indexDeletion', 'documentAddition', 'documentUpdate', 'documentDeletion', 'settingsUpdate', 'dumpCreation', 'taskCancelation'])).optional().describe('Types of tasks to delete'),
      indexUids: z.array(z.string()).optional().describe('UIDs of the indexes on which tasks to delete were performed'),
      uids: z.array(z.number()).optional().describe('UIDs of the tasks to delete'),
      canceledBy: z.array(z.number()).optional().describe('UIDs of the tasks that canceled tasks to delete'),
      beforeUid: z.number().optional().describe('Delete tasks whose uid is before this value'),
      beforeStartedAt: z.string().optional().describe('Delete tasks that started processing before this date (ISO 8601 format)'),
      beforeFinishedAt: z.string().optional().describe('Delete tasks that finished processing before this date (ISO 8601 format)'),
    },
  • The server.tool() call that registers the 'delete-tasks' tool with the MCP server, specifying name, description, input schema, and handler function.
    server.tool(
      'delete-tasks',
      'Delete tasks based on provided filters',
      {
        statuses: z.array(z.enum(['succeeded', 'failed', 'canceled'])).optional().describe('Statuses of tasks to delete'),
        types: z.array(z.enum(['indexCreation', 'indexUpdate', 'indexDeletion', 'documentAddition', 'documentUpdate', 'documentDeletion', 'settingsUpdate', 'dumpCreation', 'taskCancelation'])).optional().describe('Types of tasks to delete'),
        indexUids: z.array(z.string()).optional().describe('UIDs of the indexes on which tasks to delete were performed'),
        uids: z.array(z.number()).optional().describe('UIDs of the tasks to delete'),
        canceledBy: z.array(z.number()).optional().describe('UIDs of the tasks that canceled tasks to delete'),
        beforeUid: z.number().optional().describe('Delete tasks whose uid is before this value'),
        beforeStartedAt: z.string().optional().describe('Delete tasks that started processing before this date (ISO 8601 format)'),
        beforeFinishedAt: z.string().optional().describe('Delete tasks that finished processing before this date (ISO 8601 format)'),
      },
      async ({ statuses, types, indexUids, uids, canceledBy, beforeUid, beforeStartedAt, beforeFinishedAt }) => {
        try {
          const body: Record<string, any> = {};
          if (statuses && statuses.length > 0) body.statuses = statuses;
          if (types && types.length > 0) body.types = types;
          if (indexUids && indexUids.length > 0) body.indexUids = indexUids;
          if (uids && uids.length > 0) body.uids = uids;
          if (canceledBy && canceledBy.length > 0) body.canceledBy = canceledBy;
          if (beforeUid !== undefined) body.beforeUid = beforeUid;
          if (beforeStartedAt) body.beforeStartedAt = beforeStartedAt;
          if (beforeFinishedAt) body.beforeFinishedAt = beforeFinishedAt;
          
          const response = await apiClient.post('/tasks/delete', body);
          return {
            content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }],
          };
        } catch (error) {
          return createErrorResponse(error);
        }
      }
    );
Behavior2/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 states 'Delete' which implies a destructive operation, but doesn't disclose critical behavioral traits: whether deletion is permanent or reversible, what permissions are required, if there are rate limits, how many tasks might be affected by filters, or what happens if no filters are provided. This is inadequate for a mutation tool with zero annotation coverage.

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 with zero wasted words. It's front-loaded with the core action and resource, making it immediately understandable. Every word earns its place.

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?

For a destructive operation with 8 parameters and no annotations or output schema, the description is insufficient. It doesn't explain what 'delete' entails (permanent removal? archival?), doesn't warn about potential data loss, doesn't describe response format or error conditions, and provides no usage context. The 100% schema coverage helps with parameters but doesn't compensate for missing behavioral context.

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 the schema fully documents all 8 parameters with clear descriptions. The description adds no additional parameter semantics beyond implying filtering capability ('based on provided filters'), which is already evident from the schema. Baseline 3 is appropriate when schema does all 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 ('Delete') and resource ('tasks') with the qualification 'based on provided filters', which adds specificity. However, it doesn't explicitly differentiate this from sibling tools like 'cancel-tasks' or 'delete-documents', which handle related but different operations on tasks and documents respectively.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, constraints, or compare it to sibling tools like 'cancel-tasks' (which might stop tasks without deletion) or 'delete-documents' (which handles document removal rather than task cleanup).

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/OrionPotter/iflow-mcp_meilisearch-ts-mcp'

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