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
| Name | Required | Description | Default |
|---|---|---|---|
| indexUids | No | ||
| statuses | No | ||
| types | No | ||
| uids | No |
Implementation Reference
- src/meilisearch_mcp/server.py:641-647 (handler)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}" ) ]
- src/meilisearch_mcp/server.py:288-301 (registration)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, }, ),
- src/meilisearch_mcp/tasks.py:38-44 (helper)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)}")