Skip to main content
Glama

get_task

Retrieve a specific task from Union by providing its name, project, and domain to access task details and functionality.

Instructions

Get a union task.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYes
nameYes
projectYes

Implementation Reference

  • MCP tool handler and registration for 'get_task'. Initializes Flyte and delegates to resources.get_task to fetch and return task details as dict.
    @mcp.tool()
    @require_auth
    async def get_task(name: str, project: str, domain: str, ctx: Context) -> dict:
        """Get a union task."""
        print(f"Getting task {name} in project {project} and domain {domain}")
        _init(project, domain)
        task = await resources.get_task(name, project, domain)
        return task.to_dict()
  • Core helper function that retrieves a Flyte Task using flyte.remote.Task.get and fetches its details.
    async def get_task(
        name: str,
        project: str | None = None,
        domain: str | None = None,
        version: str | None = None,
    ) -> flyte.remote.Task:
        return flyte.remote.Task.get(
            name=name,
            project=project,
            domain=domain,
            version=version,
            auto_version="latest" if version is None else None,
        ).fetch()
  • MCP tool handler and registration for 'get_task' in v1. Uses UnionRemote to fetch task and returns string representation.
    @mcp.tool()
    @require_auth
    def get_task(name: str, project: str, domain: str, ctx: Context) -> str:
        """Get a union task."""
        print(f"Getting task {name} in project {project} and domain {domain}")
        remote = _remote(project, domain)
        task = remote.fetch_task(name=name, project=project, domain=domain)
        return str(task)

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