Skip to main content
Glama

create-image

Generate images from text descriptions and return URLs for display and download using the SupaUI MCP Server.

Instructions

"Use this tool when the user requests a new image, mentions /buou /image or asks for a image. If the customer provides the picture editing operation of the attachment, please send it to the corresponding tool. This tool ONLY returns the url of the image. After calling this tool, Please show the image returned by this tool and provide it for download.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesTranslate into English and explain the content of the customer's image.
imageYesIf the customer provides the picture editing operation of the attachment,please send it to the corresponding tool,otherwise, pass an empty string

Implementation Reference

  • The async execute method that performs the HTTP POST request to generate an image based on the input message and image parameters, returning the JSON response or an error message.
    async execute({ message, image }: z.infer<typeof this.schema>) {
      try {
        const { data } = await twentyFirstClient.post<CreateUiResponse>(
          "/api/image",
          {
            message,
            image,
          }
        );
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(data),
            },
          ],
        };
      } catch (error) {
        console.error("Error executing tool:", error);
    
        // 返回更详细的错误信息
        return {
          content: [
            {
              type: "text" as const,
              text: `Error: ${
                error instanceof Error
                  ? error.message
                  : "Failed to generate Image"
              }. Please try again.`,
            },
          ],
        };
      }
    }
  • Zod schema defining the input shape for the tool: message (description of image request) and image (editing operation or empty).
    schema = z.object({
      message: z
        .string()
        .describe(
          "Translate into English and explain the content of the customer's image."
        ),
      image: z
        .string()
        .describe(
          "If the customer provides the picture editing operation of the attachment,please send it to the corresponding tool,otherwise, pass an empty string"
        ),
    });
  • src/index.ts:15-15 (registration)
    Registers the CreateImageTool instance with the MCP server.
    new CreateImageTool().register(server);
  • Type definition for the expected response from the image creation API.
    interface CreateUiResponse {
      text: string;
    }
  • src/index.ts:6-6 (registration)
    Imports the CreateImageTool for use in the server.
    import { CreateImageTool } from "./tools/create-image";
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool only returns a URL and that the image should be shown and provided for download after calling, which adds some context. However, it lacks critical details like whether this is a generative AI tool, an upload tool, potential rate limits, authentication needs, or error handling, making it insufficient for a mutation-like operation.

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

Conciseness3/5

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

The description is relatively concise with four sentences, but it's not optimally structured. It mixes usage guidelines, parameter hints, and post-call instructions without clear separation. Some sentences could be more direct, and the repetition about the 'image' parameter from the schema reduces efficiency, though it avoids excessive verbosity.

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 no annotations, no output schema, and a tool that likely creates images (a mutation operation), the description is incomplete. It lacks details on what the tool actually does (e.g., generates images via AI, uploads files), expected inputs beyond schema basics, error cases, and output handling. The post-call instruction to show and provide the image for download is helpful but doesn't compensate for missing core behavioral context.

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 both parameters ('message' and 'image') with descriptions. The description adds minimal value by reiterating the 'image' parameter's condition but doesn't provide additional meaning beyond what's in the schema, such as format examples or usage nuances. Baseline 3 is appropriate as the schema handles most documentation.

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

Purpose2/5

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

The description states the tool is for creating images when users request them, but it's vague about what 'create' actually means (generation, upload, etc.). It doesn't clearly distinguish from sibling tools like 'fetch-ui' or 'list-ui' which might handle image retrieval. The purpose is somewhat indicated but lacks specificity about the actual creation mechanism.

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?

The description provides some usage context: use when users request a new image, mention '/buou /image', or ask for an image. It also gives an exclusion rule: if the customer provides picture editing operations, use another tool. However, it doesn't specify what the 'corresponding tool' is or offer alternatives for different scenarios, leaving gaps in guidance.

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/buoooou/mcp-ui-gen'

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