Skip to main content
Glama
meilisearch

Meilisearch MCP Server

Official
by meilisearch

cancel-tasks

Cancel tasks in Meilisearch by applying filters such as uids, indexUids, types, or statuses to manage task execution efficiently.

Instructions

Cancel tasks based on filters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexUidsNo
statusesNo
typesNo
uidsNo

Implementation Reference

  • MCP tool call handler dispatch for 'cancel-tasks': calls the MeilisearchClient's tasks.cancel_tasks method with the provided arguments and returns the result as text content.
    elif name == "cancel-tasks":
        result = self.meili_client.tasks.cancel_tasks(arguments)
        return [
            types.TextContent(
                type="text", text=f"Tasks cancelled: {result}"
            )
        ]
  • Registration of the 'cancel-tasks' tool in the MCP server's list_tools handler, including its description and input schema.
    types.Tool(
        name="cancel-tasks",
        description="Cancel tasks based on filters",
        inputSchema={
            "type": "object",
            "properties": {
                "uids": {"type": "string"},
                "indexUids": {"type": "string"},
                "types": {"type": "string"},
                "statuses": {"type": "string"},
            },
            "additionalProperties": False,
        },
    ),
  • TaskManager.cancel_tasks method: wraps the underlying Meilisearch client's cancel_tasks call, serializes the result, and handles exceptions.
    def cancel_tasks(self, query_parameters: Dict[str, Any]) -> Dict[str, Any]:
        """Cancel tasks based on query parameters"""
        try:
            result = self.client.cancel_tasks(query_parameters)
            return serialize_task_results(result)
        except Exception as e:
            raise Exception(f"Failed to cancel tasks: {str(e)}")
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 'Cancel tasks' which implies a destructive mutation, but doesn't disclose critical behaviors: whether cancellation is reversible, what happens to in-progress tasks, permissions required, rate limits, or response format. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its effects and constraints.

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 with no wasted words. It's front-loaded with the core action ('Cancel tasks'), though it could be more structured by explicitly listing key behaviors. For its brevity, it communicates the basic intent without redundancy.

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 a mutation tool with 4 parameters, 0% schema coverage, no annotations, and no output schema, the description is inadequate. It doesn't explain what 'cancel' means in this context (e.g., soft vs. hard deletion), error conditions, or return values. For a tool that likely alters system state, more detail is needed to ensure safe and correct usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It mentions 'based on filters' which hints at the four parameters (indexUids, statuses, types, uids), but provides no semantic details: what these filters mean, how they combine (AND/OR), expected formats (e.g., comma-separated lists), or examples. This adds minimal value beyond the bare schema.

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 'Cancel tasks based on filters' states a verb ('Cancel') and resource ('tasks'), but it's vague about scope and mechanism. It doesn't specify whether this cancels all matching tasks, only pending ones, or if it's irreversible. Compared to siblings like 'get-tasks' or 'get-task', it distinguishes as a mutation operation, but lacks specificity about what 'cancel' entails operationally.

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. It doesn't mention prerequisites (e.g., tasks must exist), exclusions (e.g., cannot cancel completed tasks), or related tools like 'get-tasks' for filtering first. The description implies filtering but doesn't clarify if this is the primary method for task cancellation versus other approaches.

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

Related 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/meilisearch/meilisearch-mcp'

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