Skip to main content
Glama

list_tasks

Retrieve all tasks within a specified project and domain to manage and track progress effectively.

Instructions

List all tasks in a project and domain.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYes
projectYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for list_tasks in Union v2 server, which initializes Flyte context and delegates to resources.list_tasks.
    @mcp.tool()
    @require_auth
    async def list_tasks(
        project: str,
        domain: str,
        ctx: Context,
    ) -> list[dict]:
        """List all tasks in a project and domain."""
        _init(project, domain)
        print(f"Listing tasks in project {project} and domain {domain}")
        return [task.to_dict() for task in await resources.list_tasks(project, domain)]
  • MCP tool handler for list_tasks in Union v1 server, which creates remote client and delegates to resources.list_tasks.
    @mcp.tool()
    @require_auth
    def list_tasks(
        project: str,
        domain: str,
        ctx: Context,
    ) -> list[resources.TaskMetadata]:
        """List all tasks in a project and domain."""
        remote = _remote(project, domain)
        print(f"Listing tasks in project {project} and domain {domain}")
        return resources.list_tasks(remote, project, domain)
  • Helper function in v2 resources that lists tasks using Flyte's Task.listall and fetches details.
    async def list_tasks(
        project: str | None = None,
        domain: str | None = None,
    ) -> list[flyte.remote.Task]:
        tasks = []
        for task in flyte.remote.Task.listall(project=project, domain=domain):
            tasks.append(await get_task(task.name, project=project, domain=domain))
        return tasks
  • Helper function in v1 resources that lists tasks using UnionRemote client and converts to TaskMetadata.
    def list_tasks(remote: union.UnionRemote, project: str, domain: str) -> list[TaskMetadata]:
        from flytekit.models.common import NamedEntityIdentifier
    
        id = NamedEntityIdentifier(project=project, domain=domain)
        task_models, _ = remote.client.list_tasks_paginated(id, limit=100)
        tasks = [t.to_flyte_idl() for t in task_models]
        return [
            TaskMetadata(
                name=task.id.name,
                description=task.short_description,
                inputs=proto_to_json(task.closure.compiled_task.template.interface.inputs),
                outputs=proto_to_json(task.closure.compiled_task.template.interface.outputs),
            )
            for task in tasks
        ]
  • Pydantic schema for TaskMetadata used in v1 list_tasks responses.
    class TaskMetadata(BaseModel):
        name: str
        description: str
        inputs: dict
        outputs: dict
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a list operation, implying read-only behavior, but doesn't address critical aspects like pagination, sorting, filtering beyond the two parameters, rate limits, authentication needs, or what the output contains. For a list tool with zero annotation coverage, this leaves significant gaps.

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 waste—it directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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?

Given the tool's low complexity (simple list operation with 2 parameters) and the presence of an output schema (which handles return values), the description is somewhat complete but lacks depth. It covers the basic purpose but misses behavioral details (e.g., pagination) and parameter semantics, making it adequate but with clear gaps for effective agent use.

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 schema provides no parameter descriptions. The description mentions 'project and domain' as context but doesn't explain what these parameters mean (e.g., domain types, project identifiers), their formats, or examples. It adds minimal value beyond naming the parameters, failing to compensate for the coverage gap.

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 ('List all tasks') and the target resource ('in a project and domain'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'get_task' or 'list_workflows', which would require explicit comparison to earn a 5.

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 like 'get_task' (for single tasks) or 'list_workflows' (for workflows instead of tasks). It mentions the context ('in a project and domain') but lacks explicit when/when-not instructions or named alternatives.

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/unionai-oss/union-mcp'

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