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";

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