Skip to main content
Glama
Unstructured-IO

Unstructured API MCP Server

Official

list_jobs

Retrieve and filter processing jobs from the Unstructured API by workflow ID or status to monitor document automation tasks.

Instructions

List jobs via the Unstructured API.

Args:
    workflow_id: Optional workflow ID to filter by
    status: Optional job status to filter by

Returns:
    String containing the list of jobs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflow_idNo
statusNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'list_jobs' MCP tool. It is registered via the @mcp.tool() decorator and implements the logic to list jobs from the Unstructured API, optionally filtered by workflow_id and status, sorting by creation time and returning formatted job IDs.
    @mcp.tool()
    async def list_jobs(
        ctx: Context,
        workflow_id: Optional[str] = None,
        status: Optional[JobStatus | str] = None,
    ) -> str:
        """
        List jobs via the Unstructured API.
    
        Args:
            workflow_id: Optional workflow ID to filter by
            status: Optional job status to filter by
    
        Returns:
            String containing the list of jobs
        """
        client = ctx.request_context.lifespan_context.client
    
        request = ListJobsRequest(workflow_id=workflow_id, status=status)
    
        if status:
            try:
                status = JobStatus(status) if isinstance(status, str) else status
                request.status = status
            except KeyError:
                return f"Invalid job status: {status}"
    
        response = await client.jobs.list_jobs_async(request=request)
    
        # Sort jobs by name
        sorted_jobs = sorted(
            response.response_list_jobs,
            key=lambda job: job.created_at,
        )
    
        if not sorted_jobs:
            return "No Jobs found"
    
        # Format response
        result = ["Available Jobs by created time:"]
        for job in sorted_jobs:
            result.append(f"- JOB ID: {job.id}")
    
        return "\n".join(result)
  • Registration of the list_jobs tool using the @mcp.tool() decorator.
    @mcp.tool()
  • Helper usage in gather_workflows_details function extracting list_jobs response.
    jobs: list[JobInformation] = jobs.response_list_jobs
    sources: list[SourceConnectorInformation] = sources.response_list_sources
    destinations: list[DestinationConnectorInformation] = destinations.response_list_destinations
  • Import of ListJobsRequest model used for API request schema.
    ListJobsRequest,
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool lists jobs but doesn't disclose behavioral traits like whether it's paginated, rate-limited, requires authentication, returns structured data, or has any side effects. The mention of 'String containing the list of jobs' hints at the return format but lacks detail.

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 front-loaded with the core purpose. The Args and Returns sections add structure, though 'String containing the list of jobs' is somewhat vague. No extraneous information is included.

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 (2 optional parameters) and the presence of an output schema, the description is minimally adequate. However, with no annotations and 0% schema description coverage, it should do more to explain behavioral aspects like filtering logic or return format details, which the output schema might cover but isn't described here.

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?

Schema description coverage is 0%, so the description must compensate. It adds meaningful context by explaining that 'workflow_id' and 'status' are optional filters, which clarifies their purpose beyond the schema's basic titles. However, it doesn't detail the 'status' enum values or provide examples.

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 tool's purpose as 'List jobs via the Unstructured API,' which is a specific verb+resource combination. However, it doesn't explicitly distinguish this tool from similar sibling tools like 'get_job_info' or 'list_workflows_with_finished_jobs,' which might also retrieve job-related information.

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 any prerequisites, exclusions, or compare it to sibling tools like 'get_job_info' (for single job details) or 'list_workflows_with_finished_jobs' (for a specific subset).

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