Skip to main content
Glama
Unstructured-IO

Unstructured API MCP Server

Official

delete_workflow

Remove a workflow from the Unstructured API MCP Server by specifying its ID to manage and organize data processing pipelines.

Instructions

Delete a specific workflow.

Args:
    workflow_id: ID of the workflow to delete

Returns:
    String containing the response from the workflow deletion

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflow_idYes

Implementation Reference

  • The main handler function for the 'delete_workflow' tool. It is registered via the @mcp.tool() decorator. The function takes a workflow_id, uses the UnstructuredClient to call delete_workflow_async with DeleteWorkflowRequest, and returns success or error message.
    @mcp.tool()
    async def delete_workflow(ctx: Context, workflow_id: str) -> str:
        """Delete a specific workflow.
    
        Args:
            workflow_id: ID of the workflow to delete
    
        Returns:
            String containing the response from the workflow deletion
        """
        client = ctx.request_context.lifespan_context.client
    
        try:
            response = await client.workflows.delete_workflow_async(
                request=DeleteWorkflowRequest(workflow_id=workflow_id),
            )
            return f"Workflow deleted successfully: {response.raw_response}"
        except Exception as e:
            return f"Error deleting workflow: {str(e)}"
  • Imports the DeleteWorkflowRequest schema from unstructured_client.models.operations, used in the delete_workflow handler for request validation.
        CancelJobRequest,
        CreateWorkflowRequest,
        DeleteWorkflowRequest,
        GetDestinationRequest,
        GetJobRequest,
        GetSourceRequest,
        GetWorkflowRequest,
        ListDestinationsRequest,
        ListJobsRequest,
        ListSourcesRequest,
        ListWorkflowsRequest,
        RunWorkflowRequest,
        UpdateWorkflowRequest,
    )
  • The @mcp.tool() decorator registers the delete_workflow 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