Skip to main content
Glama
Unstructured-IO

Unstructured API MCP Server

Official

list_workflows

Retrieve and filter workflows from the Unstructured API by destination, source, or status to manage data processing pipelines.

Instructions

List workflows from the Unstructured API.

Args:
    destination_id: Optional destination connector ID to filter by
    source_id: Optional source connector ID to filter by
    status: Optional workflow status to filter by

Returns:
    String containing the list of workflows

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
destination_idNo
source_idNo
statusNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler for 'list_workflows', decorated with @mcp.tool() for automatic registration. It fetches workflows from the Unstructured API client, applies optional filters for destination_id, source_id, and status, sorts them by name, and returns a formatted list.
    @mcp.tool()
    async def list_workflows(
        ctx: Context,
        destination_id: Optional[str] = None,
        source_id: Optional[str] = None,
        status: Optional[WorkflowState | str] = None,
    ) -> str:
        """
        List workflows from the Unstructured API.
    
        Args:
            destination_id: Optional destination connector ID to filter by
            source_id: Optional source connector ID to filter by
            status: Optional workflow status to filter by
    
        Returns:
            String containing the list of workflows
        """
        client = ctx.request_context.lifespan_context.client
    
        request = ListWorkflowsRequest(destination_id=destination_id, source_id=source_id)
    
        if status:
            try:
                status = WorkflowState(status) if isinstance(status, str) else status
                request.status = status
            except KeyError:
                return f"Invalid workflow status: {status}"
    
        response = await client.workflows.list_workflows_async(request=request)
    
        # Sort workflows by name
        sorted_workflows = sorted(
            response.response_list_workflows,
            key=lambda workflow: workflow.name.lower(),
        )
    
        if not sorted_workflows:
            return "No workflows found"
    
        # Format response
        result = ["Available workflows:"]
        for workflow in sorted_workflows:
            result.append(f"- {workflow.name} (ID: {workflow.id})")
    
        return "\n".join(result)
  • The @mcp.tool() decorator registers the list_workflows function as an MCP tool.
    @mcp.tool()
  • Imports ListWorkflowsRequest schema used internally by the handler for API requests to list workflows.
    from unstructured_client.models.operations import (
        CancelJobRequest,
        CreateWorkflowRequest,
        DeleteWorkflowRequest,
        GetDestinationRequest,
        GetJobRequest,
        GetSourceRequest,
        GetWorkflowRequest,
        ListDestinationsRequest,
        ListJobsRequest,
        ListSourcesRequest,
        ListWorkflowsRequest,
        RunWorkflowRequest,
        UpdateWorkflowRequest,
    )
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 states it's a list operation (implies read-only) and mentions filtering parameters, but doesn't describe important behaviors like pagination, rate limits, authentication requirements, error conditions, or what 'list' means (e.g., all workflows, only accessible ones). The return statement is minimal and doesn't explain format.

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 appropriately sized and well-structured with clear sections (Args, Returns). Each sentence earns its place by stating the purpose and documenting parameters. However, the return statement could be more informative, and there's some redundancy in 'List workflows' and 'list of workflows'.

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 3 parameters with 0% schema coverage and no annotations, the description does a decent job explaining parameters but lacks behavioral context. The presence of an output schema means the description doesn't need to detail return values, but it should still cover usage guidelines and operational aspects. For a list tool with filtering, this is minimally adequate but has clear gaps.

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

Parameters4/5

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

The description adds significant value beyond the input schema, which has 0% description coverage. It explains that parameters are optional filters (destination_id, source_id, status) and provides context about what they filter by. This compensates well for the schema's lack of descriptions, though it doesn't detail parameter formats or the status enum values.

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 'List workflows from the Unstructured API' which specifies the verb (list) and resource (workflows). It distinguishes from siblings like 'get_workflow_info' (single workflow) and 'list_workflows_with_finished_jobs' (subset with jobs), though not explicitly. However, it doesn't fully differentiate from 'list_jobs' which lists a different resource type.

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. It doesn't mention when to choose 'list_workflows' over 'get_workflow_info' (for single workflow details) or 'list_workflows_with_finished_jobs' (for workflows with completed jobs). No context about prerequisites or typical use cases 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

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/Unstructured-IO/UNS-MCP'

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