Skip to main content
Glama

venice_generate_image

Create images from text descriptions using AI models, with options to specify size, style, and content to avoid.

Instructions

Generate an image from a text prompt using Venice AI

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesText description of the image to generate
modelNoImage model (e.g., fluently-xl, flux-dev)fluently-xl
sizeNoImage size (e.g., 512x512, 1024x1024, 1792x1024)1024x1024
style_presetNoStyle preset name
negative_promptNoWhat to avoid in the image

Implementation Reference

  • The handler function for venice_generate_image tool. It constructs the request body, calls the Venice AI /images/generations API, handles errors, decodes and saves b64_json image to ~/venice-images/, or returns URL, and formats response as MCP content.
    async ({ prompt, model, size, style_preset, negative_prompt }) => {
      const body: Record<string, unknown> = { model, prompt, size, n: 1, response_format: "b64_json" };
      if (style_preset) body.style_preset = style_preset;
      if (negative_prompt) body.negative_prompt = negative_prompt;
    
      const response = await veniceAPI("/images/generations", { method: "POST", body: JSON.stringify(body) });
      const data = await response.json() as ImageGenerationResponse;
      if (!response.ok) return { content: [{ type: "text" as const, text: `Error: ${data.error?.message || response.statusText}` }] };
    
      const img = data.data?.[0];
      if (img?.b64_json) {
        const outputDir = getImageOutputDir();
        const filename = `venice-${Date.now()}.png`;
        const filepath = join(outputDir, filename);
        writeFileSync(filepath, Buffer.from(img.b64_json, "base64"));
        return {
          content: [{
            type: "text" as const,
            text: JSON.stringify({ success: true, path: filepath }),
          }],
        };
      }
      if (img?.url) return { content: [{ type: "text" as const, text: JSON.stringify({ success: true, url: img.url }) }] };
      return { content: [{ type: "text" as const, text: JSON.stringify({ success: false, error: "No image data returned" }) }] };
    }
  • Input schema using Zod for the venice_generate_image tool parameters: prompt (string), model (string opt default 'fluently-xl'), size (string opt '1024x1024'), style_preset (opt), negative_prompt (opt).
    {
      prompt: z.string().describe("Text description of the image to generate"),
      model: z.string().optional().default("fluently-xl").describe("Image model (e.g., fluently-xl, flux-dev)"),
      size: z.string().optional().default("1024x1024").describe("Image size (e.g., 512x512, 1024x1024, 1792x1024)"),
      
      style_preset: z.string().optional().describe("Style preset name"),
      negative_prompt: z.string().optional().describe("What to avoid in the image"),
    },
  • Direct registration of the 'venice_generate_image' tool on the MCP server via server.tool(), specifying name, description, input schema, and execution handler.
    server.tool(
      "venice_generate_image",
      "Generate an image from a text prompt using Venice AI",
      {
        prompt: z.string().describe("Text description of the image to generate"),
        model: z.string().optional().default("fluently-xl").describe("Image model (e.g., fluently-xl, flux-dev)"),
        size: z.string().optional().default("1024x1024").describe("Image size (e.g., 512x512, 1024x1024, 1792x1024)"),
        
        style_preset: z.string().optional().describe("Style preset name"),
        negative_prompt: z.string().optional().describe("What to avoid in the image"),
      },
      async ({ prompt, model, size, style_preset, negative_prompt }) => {
        const body: Record<string, unknown> = { model, prompt, size, n: 1, response_format: "b64_json" };
        if (style_preset) body.style_preset = style_preset;
        if (negative_prompt) body.negative_prompt = negative_prompt;
    
        const response = await veniceAPI("/images/generations", { method: "POST", body: JSON.stringify(body) });
        const data = await response.json() as ImageGenerationResponse;
        if (!response.ok) return { content: [{ type: "text" as const, text: `Error: ${data.error?.message || response.statusText}` }] };
    
        const img = data.data?.[0];
        if (img?.b64_json) {
          const outputDir = getImageOutputDir();
          const filename = `venice-${Date.now()}.png`;
          const filepath = join(outputDir, filename);
          writeFileSync(filepath, Buffer.from(img.b64_json, "base64"));
          return {
            content: [{
              type: "text" as const,
              text: JSON.stringify({ success: true, path: filepath }),
            }],
          };
        }
        if (img?.url) return { content: [{ type: "text" as const, text: JSON.stringify({ success: true, url: img.url }) }] };
        return { content: [{ type: "text" as const, text: JSON.stringify({ success: false, error: "No image data returned" }) }] };
      }
    );
  • src/index.ts:15-18 (registration)
    Top-level registration of tool groups in main server entrypoint; registerInferenceTools includes the venice_generate_image tool.
    // Register all tool categories
    registerInferenceTools(server);
    registerDiscoveryTools(server);
    registerAdminTools(server);
  • Helper function to get or create the local directory ~/venice-images/ for saving generated images.
    function getImageOutputDir(): string {
      const dir = join(homedir(), "venice-images");
      if (!existsSync(dir)) {
        mkdirSync(dir, { recursive: true });
      }
      return dir;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It states what the tool does but doesn't mention rate limits, authentication requirements, cost implications, generation time, or output format details. For a generative AI tool with potential complexity, this leaves significant behavioral aspects undocumented.

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?

The description is extremely concise - a single sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core functionality and uses efficient language. Every word earns its place in communicating the essential function.

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 5 parameters and no output schema, the description is insufficient. It doesn't explain what the tool returns (image format, URL, metadata), doesn't mention quality expectations, error conditions, or limitations. With no annotations and no output schema, the agent lacks critical information about the tool's behavior and results.

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?

Schema description coverage is 100%, so all parameters are documented in the schema itself. The description doesn't add any parameter-specific information beyond what's in the schema descriptions. This meets the baseline expectation when schema coverage is complete, but doesn't provide additional context about parameter interactions or best practices.

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

Purpose4/5

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

The description clearly states the action ('Generate an image') and resource ('from a text prompt using Venice AI'), making the purpose immediately understandable. It distinguishes from siblings like text-to-speech or upscale tools by focusing on image generation from text. However, it doesn't explicitly differentiate from other AI image generators that might exist in the broader context.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when this tool is appropriate compared to other image generation methods, nor does it specify prerequisites or constraints. The agent must infer usage solely from the tool name and parameters.

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/georgeglarson/venice-mcp'

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