Skip to main content
Glama
snussik
by snussik

download_batch_results

Retrieve processed OCR results from completed batch jobs to access extracted text and structured data in markdown or HTML formats.

Instructions

Download results from a completed batch job.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argumentsYes

Implementation Reference

  • The handler implementation for the 'download_batch_results' tool, which takes a 'job_id', downloads the results using the batch processor, and returns the path to the results file.
    @app.tool("download_batch_results")
    async def download_batch_results(arguments: Dict[str, Any]) -> List[TextContent]:
        """Download results from a completed 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()
            results_path = await batch_proc.download_job_results(job_id, config.output_dir)
    
            return [
                TextContent(
                    type="text",
                    text=json.dumps(
                        {
                            "message": "Batch results downloaded successfully",
                            "results_file": results_path,
                            "job_id": job_id,
                        },
                        indent=2,
                        ensure_ascii=False,
                    ),
                )
            ]
        except Exception as e:
            raise McpError(
                ErrorData(
                    code=INTERNAL_ERROR,
                    message=f"Error downloading batch results: {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