Skip to main content
Glama
Unstructured-IO

Unstructured API MCP Server

Official

cancel_job

Terminate a specific job by its ID using this tool, which removes the job from the Unstructured API MCP Server and returns the cancellation response.

Instructions

Delete a specific job.

Args: job_id: ID of the job to cancel Returns: String containing the response from the job cancellation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYes

Implementation Reference

  • The primary MCP tool handler for 'cancel_job'. It uses the UnstructuredClient to cancel a job by ID and returns a success or error message.
    @mcp.tool() async def cancel_job(ctx: Context, job_id: str) -> str: """Delete a specific job. Args: job_id: ID of the job to cancel Returns: String containing the response from the job cancellation """ client = ctx.request_context.lifespan_context.client try: response = await client.jobs.cancel_job_async( request=CancelJobRequest(job_id=job_id), ) return f"Job canceled successfully: {response.raw_response}" except Exception as e: return f"Error canceling job: {str(e)}"
  • Import of CancelJobRequest model used in the cancel_job handler for request validation.
    CancelJobRequest,
  • The @mcp.tool() decorator registers the cancel_job function as an MCP tool.
    @mcp.tool()

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