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
| Name | Required | Description | Default |
|---|---|---|---|
| workflow_id | Yes |
Implementation Reference
- uns_mcp/server.py:443-462 (handler)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)}"
- uns_mcp/server.py:22-35 (schema)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, )
- uns_mcp/server.py:443-443 (registration)The @mcp.tool() decorator registers the delete_workflow function as an MCP tool.@mcp.tool()