cancel_batch_job
Stop a running batch OCR processing job in the MCP Mistral OCR Optimized server to manage document extraction operations.
Instructions
Cancel a running batch job.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| arguments | Yes |
Implementation Reference
- src/mcp_mistral_ocr_opt/main.py:578-599 (handler)The cancel_batch_job tool handler, which validates the job_id argument and calls the batch processor to cancel the job.
@app.tool("cancel_batch_job") async def cancel_batch_job(arguments: Dict[str, Any]) -> List[TextContent]: """Cancel a running batch job.""" job_id = arguments.get("job_id") if not job_id: raise McpError(ErrorData(code=INVALID_PARAMS, message="job_id is required")) try: batch_proc = await get_batch_processor() result = await batch_proc.cancel_job(job_id) return [ TextContent( type="text", text=json.dumps(result, indent=2, ensure_ascii=False) ) ] except Exception as e: raise McpError( ErrorData( code=INTERNAL_ERROR, message=f"Error canceling batch job: {str(e)}" ) )