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) }] }; } );

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