Skip to main content
Glama

image_generate

Create custom images from text descriptions using the Flux 1.1 Pro AI model for visual content needs.

Instructions

Generate an image using Flux 1.1 Pro AI model ($0.005)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesImage description
widthNo
heightNo

Implementation Reference

  • The tool is executed by calling the `callTool` function, which maps the tool name to an endpoint and makes a fetch request to the IteraTools API. The `CallToolRequestSchema` handler in `index.js` acts as the dispatcher for `image_generate` (and all other tools).
      const tool = TOOLS.find(t => t.name === name);
      if (!tool) {
        return { content: [{ type: 'text', text: `Unknown tool: ${name}` }], isError: true };
      }
      
      try {
        const result = await callTool(tool.endpoint, args);
        return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
      } catch (err) {
        return { content: [{ type: 'text', text: `Error: ${err.message}` }], isError: true };
      }
    });
  • index.js:17-17 (registration)
    The `image_generate` tool is registered in the `TOOLS` array in `index.js`.
    { name: 'image_generate', description: 'Generate an image using Flux 1.1 Pro AI model', inputSchema: { type: 'object', properties: { prompt: { type: 'string', description: 'Image description' }, width: { type: 'number', default: 1024 }, height: { type: 'number', default: 1024 } }, required: ['prompt'] }, endpoint: '/image/generate', price: '$0.005' },
  • The `callTool` helper function handles the actual API request to the IteraTools backend.
    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;
    }
Behavior3/5

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

No annotations provided, so description carries full burden. It adds critical cost information ($0.005) and model context, but fails to disclose return format (URL vs base64), latency expectations, or content policy restrictions typical for image generation.

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 sentence with zero waste. Front-loaded with essential differentiators (model name, cost). Every word earns its place.

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

Completeness2/5

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

For an image generation tool with no output schema, description inadequately explains what gets returned (image URL? base64? file path?). Also omits expected resolution defaults and behavioral constraints despite having complex siblings.

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

Parameters2/5

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

Schema coverage is only 33% (only 'prompt' described). Description fails to compensate for undocumented width/height parameters—no mention of aspect ratio implications, valid ranges, or defaults despite these being critical for image generation.

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?

Excellent specificity: states exact verb (Generate), resource (image), model (Flux 1.1 Pro), and cost ($0.005). The model name distinguishes it from sibling 'image_fast' and other generation tools.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus siblings like 'image_fast' (likely a cheaper/faster alternative) or 'video_generate'. Missing selection criteria for choosing Flux 1.1 Pro over other models.

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