Skip to main content
Glama
meilisearch

Meilisearch MCP Server

Official
by meilisearch

get-tasks

Retrieve a filtered list of tasks from the Meilisearch MCP Server using parameters like task type, status, batch IDs, and timestamps for precise task management.

Instructions

Get list of tasks with optional filters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
afterEnqueuedAtNo
afterFinishedAtNo
afterStartedAtNo
batchUidsNo
beforeEnqueuedAtNo
beforeFinishedAtNo
beforeStartedAtNo
canceledByNo
fromNo
indexUidsNo
limitNo
reverseNo
statusesNo
typesNo
uidsNo

Implementation Reference

  • MCP tool handler execution logic for 'get-tasks', filters arguments and delegates to MeilisearchClient.tasks.get_tasks
    elif name == "get-tasks":
        # Filter out any invalid parameters
        valid_params = {
            "limit",
            "from",
            "reverse",
            "batchUids",
            "uids",
            "canceledBy",
            "types",
            "statuses",
            "indexUids",
            "afterEnqueuedAt",
            "beforeEnqueuedAt",
            "afterStartedAt",
            "beforeStartedAt",
            "afterFinishedAt",
            "beforeFinishedAt",
        }
        filtered_args = (
            {k: v for k, v in arguments.items() if k in valid_params}
            if arguments
            else {}
        )
        tasks = self.meili_client.tasks.get_tasks(filtered_args)
        return [types.TextContent(type="text", text=f"Tasks: {tasks}")]
  • Input schema definition for the 'get-tasks' tool, specifying all filter parameters
    types.Tool(
        name="get-tasks",
        description="Get list of tasks with optional filters",
        inputSchema={
            "type": "object",
            "properties": {
                "limit": {"type": "integer"},
                "from": {"type": "integer"},
                "reverse": {"type": "boolean"},
                "batchUids": {
                    "type": "array",
                    "items": {"type": "string"},
                },
                "uids": {
                    "type": "array",
                    "items": {"type": "integer"},
                },
                "canceledBy": {
                    "type": "array",
                    "items": {"type": "string"},
                },
                "types": {
                    "type": "array",
                    "items": {"type": "string"},
                },
                "statuses": {
                    "type": "array",
                    "items": {"type": "string"},
                },
                "indexUids": {
                    "type": "array",
                    "items": {"type": "string"},
                },
                "afterEnqueuedAt": {"type": "string"},
                "beforeEnqueuedAt": {"type": "string"},
                "afterStartedAt": {"type": "string"},
                "beforeStartedAt": {"type": "string"},
                "afterFinishedAt": {"type": "string"},
                "beforeFinishedAt": {"type": "string"},
            },
            "additionalProperties": False,
        },
    ),
  • Helper method in TaskManager that wraps Meilisearch client's get_tasks with serialization
    def get_tasks(self, parameters: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
        """Get list of tasks with optional filters"""
        try:
            tasks = self.client.get_tasks(parameters)
            return serialize_task_results(tasks)
        except Exception as e:
            raise Exception(f"Failed to get tasks: {str(e)}")
  • Tool registration via the list_tools handler that returns the list of available tools including 'get-tasks'
    @self.server.list_tools()
    async def handle_list_tools() -> list[types.Tool]:
        """List available tools"""
        return [
            types.Tool(
                name="get-connection-settings",
                description="Get current Meilisearch connection settings",
                inputSchema={
                    "type": "object",
                    "properties": {},
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="update-connection-settings",
                description="Update Meilisearch connection settings",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "url": {"type": "string"},
                        "api_key": {"type": "string"},
                    },
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="health-check",
                description="Check Meilisearch server health",
                inputSchema={
                    "type": "object",
                    "properties": {},
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="get-version",
                description="Get Meilisearch version information",
                inputSchema={
                    "type": "object",
                    "properties": {},
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="get-stats",
                description="Get database statistics",
                inputSchema={
                    "type": "object",
                    "properties": {},
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="create-index",
                description="Create a new Meilisearch index",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "uid": {"type": "string"},
                        "primaryKey": {"type": "string"},
                    },
                    "required": ["uid"],
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="list-indexes",
                description="List all Meilisearch indexes",
                inputSchema={
                    "type": "object",
                    "properties": {},
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="delete-index",
                description="Delete a Meilisearch index",
                inputSchema={
                    "type": "object",
                    "properties": {"uid": {"type": "string"}},
                    "required": ["uid"],
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="get-documents",
                description="Get documents from an index",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "indexUid": {"type": "string"},
                        "offset": {"type": "integer"},
                        "limit": {"type": "integer"},
                    },
                    "required": ["indexUid"],
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="add-documents",
                description="Add documents to an index",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "indexUid": {"type": "string"},
                        "documents": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "additionalProperties": True,
                            },
                        },
                        "primaryKey": {"type": "string"},
                    },
                    "required": ["indexUid", "documents"],
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="get-settings",
                description="Get current settings for an index",
                inputSchema={
                    "type": "object",
                    "properties": {"indexUid": {"type": "string"}},
                    "required": ["indexUid"],
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="update-settings",
                description="Update settings for an index",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "indexUid": {"type": "string"},
                        "settings": {
                            "type": "object",
                            "additionalProperties": True,
                        },
                    },
                    "required": ["indexUid", "settings"],
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="search",
                description="Search through Meilisearch indices. If indexUid is not provided, it will search across all indices.",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "query": {"type": "string"},
                        "indexUid": {"type": "string"},
                        "limit": {"type": "integer"},
                        "offset": {"type": "integer"},
                        "filter": {"type": "string"},
                        "sort": {
                            "type": "array",
                            "items": {"type": "string"},
                        },
                    },
                    "required": ["query"],
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="get-task",
                description="Get information about a specific task",
                inputSchema={
                    "type": "object",
                    "properties": {"taskUid": {"type": "integer"}},
                    "required": ["taskUid"],
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="get-tasks",
                description="Get list of tasks with optional filters",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "limit": {"type": "integer"},
                        "from": {"type": "integer"},
                        "reverse": {"type": "boolean"},
                        "batchUids": {
                            "type": "array",
                            "items": {"type": "string"},
                        },
                        "uids": {
                            "type": "array",
                            "items": {"type": "integer"},
                        },
                        "canceledBy": {
                            "type": "array",
                            "items": {"type": "string"},
                        },
                        "types": {
                            "type": "array",
                            "items": {"type": "string"},
                        },
                        "statuses": {
                            "type": "array",
                            "items": {"type": "string"},
                        },
                        "indexUids": {
                            "type": "array",
                            "items": {"type": "string"},
                        },
                        "afterEnqueuedAt": {"type": "string"},
                        "beforeEnqueuedAt": {"type": "string"},
                        "afterStartedAt": {"type": "string"},
                        "beforeStartedAt": {"type": "string"},
                        "afterFinishedAt": {"type": "string"},
                        "beforeFinishedAt": {"type": "string"},
                    },
                    "additionalProperties": False,
                },
            ),
            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,
                },
            ),
            types.Tool(
                name="get-keys",
                description="Get list of API keys",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "offset": {"type": "integer"},
                        "limit": {"type": "integer"},
                    },
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="create-key",
                description="Create a new API key",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "description": {"type": "string"},
                        "actions": {"type": "array", "items": {"type": "string"}},
                        "indexes": {"type": "array", "items": {"type": "string"}},
                        "expiresAt": {"type": "string"},
                    },
                    "required": ["actions", "indexes"],
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="delete-key",
                description="Delete an API key",
                inputSchema={
                    "type": "object",
                    "properties": {"key": {"type": "string"}},
                    "required": ["key"],
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="get-health-status",
                description="Get comprehensive health status of Meilisearch",
                inputSchema={
                    "type": "object",
                    "properties": {},
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="get-index-metrics",
                description="Get detailed metrics for an index",
                inputSchema={
                    "type": "object",
                    "properties": {"indexUid": {"type": "string"}},
                    "required": ["indexUid"],
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="get-system-info",
                description="Get system-level information",
                inputSchema={
                    "type": "object",
                    "properties": {},
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="create-chat-completion",
                description="Create a conversational chat completion using Meilisearch's chat feature",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "workspace_uid": {
                            "type": "string",
                            "description": "Unique identifier of the chat workspace",
                        },
                        "messages": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "role": {
                                        "type": "string",
                                        "enum": ["user", "assistant", "system"],
                                    },
                                    "content": {"type": "string"},
                                },
                                "required": ["role", "content"],
                            },
                            "description": "List of message objects comprising the chat history",
                        },
                        "model": {
                            "type": "string",
                            "default": "gpt-3.5-turbo",
                            "description": "The model to use for completion",
                        },
                        "stream": {
                            "type": "boolean",
                            "default": True,
                            "description": "Whether to stream the response (currently must be true)",
                        },
                    },
                    "required": ["workspace_uid", "messages"],
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="get-chat-workspaces",
                description="Get list of available chat workspaces",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "offset": {
                            "type": "integer",
                            "description": "Number of workspaces to skip",
                        },
                        "limit": {
                            "type": "integer",
                            "description": "Maximum number of workspaces to return",
                        },
                    },
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="get-chat-workspace-settings",
                description="Get settings for a specific chat workspace",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "workspace_uid": {
                            "type": "string",
                            "description": "Unique identifier of the chat workspace",
                        },
                    },
                    "required": ["workspace_uid"],
                    "additionalProperties": False,
                },
            ),
            types.Tool(
                name="update-chat-workspace-settings",
                description="Update settings for a specific chat workspace",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "workspace_uid": {
                            "type": "string",
                            "description": "Unique identifier of the chat workspace",
                        },
                        "settings": {
                            "type": "object",
                            "description": "Settings to update for the workspace",
                            "additionalProperties": True,
                        },
                    },
                    "required": ["workspace_uid", "settings"],
                    "additionalProperties": False,
                },
            ),
        ]
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It only states it 'gets' tasks with filters, implying a read operation, but doesn't disclose important behaviors like whether this is paginated (given 'from' and 'limit' parameters), rate limits, authentication requirements, or what the response format looks like. For a tool with 15 parameters and no annotations, this is inadequate.

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 extremely concise at just 7 words with zero wasted language. It's front-loaded with the core purpose and efficiently mentions the filtering capability. Every word earns its place in this minimal description.

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 the complexity (15 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what 'tasks' are in this system's context, doesn't describe the return format, doesn't address pagination behavior (implied by 'from' and 'limit' parameters), and provides minimal guidance on the extensive filtering options. For a list operation with many parameters, more context is needed.

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 'optional filters' which hints at the 15 parameters, but provides no semantic context about what these filters do (e.g., date filtering, status filtering, UID filtering). The description doesn't explain any parameters beyond the generic 'filters' mention, leaving significant gaps.

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 'Get list of tasks with optional filters' clearly states the verb ('Get') and resource ('tasks'), but it's vague about what 'tasks' are in this context and doesn't differentiate from sibling tools like 'get-task' (singular) or 'cancel-tasks'. It provides basic purpose but lacks specificity about the domain or scope.

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?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of when to use 'get-tasks' versus 'get-task' (singular), 'cancel-tasks', or other sibling tools. No context about prerequisites, appropriate scenarios, or exclusions is provided.

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