delete_workflow
Remove a specific workflow by its ID using the Unstructured API MCP Server. This action permanently deletes the workflow and returns a response confirming the deletion.
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-461 (handler)The handler function for the 'delete_workflow' tool. It is decorated with @mcp.tool() for registration and implements the logic to delete a workflow using the UnstructuredClient API, handling the DeleteWorkflowRequest and returning success or error messages.@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:21-35 (schema)Import of DeleteWorkflowRequest schema used in the delete_workflow handler for input validation.from unstructured_client.models.operations import ( CancelJobRequest, CreateWorkflowRequest, DeleteWorkflowRequest, GetDestinationRequest, GetJobRequest, GetSourceRequest, GetWorkflowRequest, ListDestinationsRequest, ListJobsRequest, ListSourcesRequest, ListWorkflowsRequest, RunWorkflowRequest, UpdateWorkflowRequest, )