Skip to main content
Glama
DumplingAI

Dumpling AI MCP Server

Official
by DumplingAI

generate-ai-image

Create AI-generated images from text prompts using specified models and parameters for visual content production.

Instructions

Generate AI images from text prompts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesModel to use for generation
inputYesModel-specific parameters

Implementation Reference

  • The handler function for the 'generate-ai-image' tool. It proxies the request to the Dumpling AI API endpoint `/api/v1/generate-ai-image` using the provided model and input parameters, and returns the JSON response as text content.
    async ({ model, input }) => {
      const apiKey = process.env.DUMPLING_API_KEY;
      if (!apiKey) throw new Error("DUMPLING_API_KEY not set");
      const response = await fetch(`${NWS_API_BASE}/api/v1/generate-ai-image`, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          Authorization: `Bearer ${apiKey}`,
        },
        body: JSON.stringify({ model, input }),
      });
      if (!response.ok)
        throw new Error(`Failed: ${response.status} ${await response.text()}`);
      const data = await response.json();
      return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
    }
  • Zod schema defining the input parameters for the 'generate-ai-image' tool: 'model' (required string) and 'input' (object with prompt, seed, num_outputs, etc.).
    {
      model: z.string().describe("Model to use for generation"),
      input: z
        .object({
          prompt: z.string().describe("Text prompt"),
          seed: z.number().optional().describe("Random seed"),
          num_outputs: z.number().optional().describe("Number of images"),
          aspect_ratio: z.string().optional().describe("Aspect ratio"),
          output_format: z.string().optional().describe("Output format"),
          output_quality: z.number().optional().describe("Output quality"),
          num_inference_steps: z.number().optional().describe("Inference steps"),
          guidance: z.number().optional().describe("Guidance scale"),
        })
        .describe("Model-specific parameters"),
    },
  • src/index.ts:952-986 (registration)
    The server.tool() call that registers the 'generate-ai-image' tool, including its name, description, input schema, and inline handler function.
    server.tool(
      "generate-ai-image",
      "Generate AI images from text prompts.",
      {
        model: z.string().describe("Model to use for generation"),
        input: z
          .object({
            prompt: z.string().describe("Text prompt"),
            seed: z.number().optional().describe("Random seed"),
            num_outputs: z.number().optional().describe("Number of images"),
            aspect_ratio: z.string().optional().describe("Aspect ratio"),
            output_format: z.string().optional().describe("Output format"),
            output_quality: z.number().optional().describe("Output quality"),
            num_inference_steps: z.number().optional().describe("Inference steps"),
            guidance: z.number().optional().describe("Guidance scale"),
          })
          .describe("Model-specific parameters"),
      },
      async ({ model, input }) => {
        const apiKey = process.env.DUMPLING_API_KEY;
        if (!apiKey) throw new Error("DUMPLING_API_KEY not set");
        const response = await fetch(`${NWS_API_BASE}/api/v1/generate-ai-image`, {
          method: "POST",
          headers: {
            "Content-Type": "application/json",
            Authorization: `Bearer ${apiKey}`,
          },
          body: JSON.stringify({ model, input }),
        });
        if (!response.ok)
          throw new Error(`Failed: ${response.status} ${await response.text()}`);
        const data = await response.json();
        return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Generate AI images from text prompts' indicates a creation operation but doesn't disclose traits like rate limits, authentication needs, cost implications, or output behavior (e.g., whether images are saved or returned as data). For a generative AI tool with zero annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence: 'Generate AI images from text prompts.' It is front-loaded with the core purpose and contains no wasted words, making it highly concise and well-structured for quick understanding.

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?

Given the complexity of an AI image generation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits (e.g., latency, costs), output format (e.g., image URLs or binary data), and error handling. For a tool with 2 parameters (including a nested object) and rich functionality, the description should provide more context to be fully helpful.

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 the schema already documents all parameters (e.g., 'model', 'input.prompt'). The description adds no additional meaning beyond what the schema provides—it doesn't explain parameter relationships, default values, or usage examples. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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 tool's purpose: 'Generate AI images from text prompts.' It specifies the verb ('Generate') and resource ('AI images'), and distinguishes it from sibling tools like 'extract-image' or 'screenshot' which handle existing images rather than generating new ones. However, it doesn't explicitly differentiate from all siblings (e.g., 'generate-agent-completion' is also a generation tool but for text).

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 prerequisites (e.g., needing a text prompt), exclusions (e.g., not for editing existing images), or comparisons to sibling tools like 'extract-image' for image extraction or 'generate-agent-completion' for text generation. Usage is implied only by the tool's name and description.

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/DumplingAI/mcp-server-dumplingai'

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