Skip to main content
Glama
snussik
by snussik

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
NameRequiredDescriptionDefault
argumentsYes

Implementation Reference

  • 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)}"
                )
            )

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/snussik/mcp_mistral_ocr_opt'

If you have feedback or need assistance with the MCP directory API, please join our Discord server