Skip to main content
Glama
snussik
by snussik

list_tools

Discover available OCR processing tools for extracting text and tables from documents into structured formats.

Instructions

List available OCR tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `list_tools` function is registered as an MCP tool via the `@app.tool("list_tools")` decorator. It returns a list of available `Tool` definitions, which include the tools supported by the OCR server.
    @app.tool("list_tools")
    async def list_tools() -> List[Tool]:
        """List available OCR tools."""
        return [
            Tool(
                name="process_local_file",
                description="Process a single local file from OCR_DIR with optional parameters",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "filename": {
                            "type": "string",
                            "description": "Name of the file to process (relative to OCR_DIR)",
                        },
                        "table_format": {
                            "type": "string",
                            "description": "Table formatting: null (inline), markdown, or html",
                            "enum": ["null", "markdown", "html"],
                        },
                        "extract_header": {
                            "type": "boolean",
                            "description": "Extract document headers (default: false)",
                        },
                        "extract_footer": {
                            "type": "boolean",
                            "description": "Extract document footers (default: false)",
                        },
                        "include_images": {
                            "type": "boolean",
                            "description": "Include base64 images in output (default: false for token efficiency)",
                        },
                    },
                    "required": ["filename"],
                },
            ),
            Tool(
                name="process_batch_local_files",
                description="Process multiple local files concurrently (optimal for 5+ files)",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "patterns": {
                            "type": "array",
                            "items": {"type": "string"},
                            "description": "Glob patterns to match files (e.g., ['*.pdf', 'scanned_*.jpg'])",
                        },
                        "max_files": {
                            "type": "integer",
                            "description": "Maximum number of files to process",
                        },
                        "table_format": {
                            "type": "string",
                            "description": "Table formatting: null, markdown, or html",
                            "enum": ["null", "markdown", "html"],
                        },
                        "extract_header": {
                            "type": "boolean",
                            "description": "Extract document headers",
                        },
                        "extract_footer": {
                            "type": "boolean",
                            "description": "Extract document footers",
                        },
                        "include_images": {
                            "type": "boolean",
                            "description": "Include base64 images in output",
                        },
                    },
                    "required": ["patterns"],
                },
            ),
            Tool(
                name="process_url_file",
                description="Process a file from a URL",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "url": {
                            "type": "string",
                            "description": "URL of the file to process",
                        },
                        "file_type": {
                            "type": "string",
                            "description": "Type of file: 'image' or 'pdf'",
                            "enum": ["image", "pdf"],
                        },
                        "table_format": {
                            "type": "string",
                            "description": "Table formatting: null, markdown, or html",
                            "enum": ["null", "markdown", "html"],
                        },
                        "extract_header": {
                            "type": "boolean",
                            "description": "Extract document headers",
                        },
                        "extract_footer": {
                            "type": "boolean",
                            "description": "Extract document footers",
                        },
                        "include_images": {
                            "type": "boolean",
                            "description": "Include base64 images in output",
                        },
                    },
                    "required": ["url", "file_type"],
                },
            ),
            Tool(
                name="create_batch_job",
                description="Create a batch processing job for large file sets (saves up to 50% cost)",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "patterns": {
                            "type": "array",
                            "items": {"type": "string"},
                            "description": "Glob patterns to match files",
                        },
                        "use_inline": {
                            "type": "boolean",
                            "description": "Use inline batch (for <10k files) or file batch (for larger)",
                        },
                        "table_format": {
                            "type": "string",
                            "description": "Table formatting: null, markdown, or html",
                            "enum": ["null", "markdown", "html"],
                        },
                        "extract_header": {
                            "type": "boolean",
                            "description": "Extract document headers",
                        },
                        "extract_footer": {
                            "type": "boolean",
                            "description": "Extract document footers",
                        },
                        "include_images": {
                            "type": "boolean",
                            "description": "Include base64 images in output",
                        },
                    },
                    "required": ["patterns"],
                },
            ),
            Tool(
                name="check_batch_status",
                description="Check the status of a batch processing job",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "job_id": {
                            "type": "string",
                            "description": "Batch job ID",
                        },
                    },
                    "required": ["job_id"],
                },
            ),
            Tool(
                name="download_batch_results",
                description="Download results from a completed batch job",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "job_id": {
                            "type": "string",
                            "description": "Batch job ID",
                        },
                    },
                    "required": ["job_id"],
                },
            ),
            Tool(
                name="cancel_batch_job",
                description="Cancel a running batch job",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "job_id": {
                            "type": "string",
                            "description": "Batch job ID",
                        },
                    },
                    "required": ["job_id"],
                },
            ),
            Tool(
                name="list_batch_jobs",
                description="List batch jobs with optional filtering",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "status": {
                            "type": "string",
                            "description": "Filter by status (QUEUED, RUNNING, SUCCESS, FAILED, etc.)",
                        },
                    },
                    "required": [],
                },
            ),
        ]

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