Skip to main content
Glama

image_ocr

Extract text from images using OCR technology. Convert image content into editable text by providing an image URL.

Instructions

Extract text from an image using OCR ($0.002)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesImage URL

Implementation Reference

  • index.js:50-79 (handler)
    The callTool function performs the actual HTTP request to the API, which is used by image_ocr via its endpoint '/image/ocr'.
    async function callTool(endpoint, params) {
      const fetch = (await import('node-fetch')).default;
      const isGet = ['GET'].includes((TOOLS.find(t => t.endpoint === endpoint) || {}).method);
      
      const url = isGet 
        ? `${BASE_URL}${endpoint}?${new URLSearchParams(params)}`
        : `${BASE_URL}${endpoint}`;
      
      const res = await fetch(url, {
        method: isGet ? 'GET' : 'POST',
        headers: {
          'Content-Type': 'application/json',
          'Authorization': `Bearer ${API_KEY}`,
        },
        body: isGet ? undefined : JSON.stringify(params),
      });
      
      const text = await res.text();
      let data;
      try { data = JSON.parse(text); } catch { data = { raw: text }; }
      
      if (!res.ok) {
        if (res.status === 402) {
          throw new Error(`Insufficient credits. Add credits at https://iteratools.com. Cost: ${TOOLS.find(t=>t.endpoint===endpoint)?.price || 'see docs'}`);
        }
        throw new Error(`API error ${res.status}: ${text.substring(0, 200)}`);
      }
      
      return data;
    }
  • index.js:21-21 (registration)
    The definition and registration of the 'image_ocr' tool in the TOOLS configuration array.
    { name: 'image_ocr', description: 'Extract text from an image using OCR', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'Image URL' } }, required: ['url'] }, endpoint: '/image/ocr', price: '$0.002' },
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses cost ($0.002) which is valuable behavioral context absent from annotations. However, lacking annotations, the description fails to clarify safety profile (read-only vs destructive), supported image formats, language limitations, or output structure (plain text vs JSON with coordinates).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single efficient sentence fragment with zero waste. Cost information is contextually valuable and earns its place. Immediate front-loading of action ('Extract text') followed by method and cost.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a single-parameter tool with high schema coverage. Core operation is clear, though output format specifics would strengthen completeness given the absence of an output schema (implied to return text but format unspecified).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage ('Image URL'), the baseline is 3. The description implies the URL should point to an image via 'Extract text from an image' but adds no specific syntax guidance, format constraints, or examples beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Specific verb 'Extract' + resource 'text from an image' + method 'using OCR' provides exact operational scope. Clearly distinguishes from siblings like image_generate, image_resize, and image_rembg by specifying text extraction rather than image manipulation or generation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the OCR designation (use when needing text from image files), but lacks explicit when-to-use guidance versus alternatives like pdf_extract for documents or scrape for web text, and omits prerequisites like URL accessibility requirements.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/fredpsantos33/itera-tools-mcp'

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