Skip to main content
Glama

create-image

Generate and retrieve image URLs on request or when triggered by specific commands like /buou /image. Display and provide the image for download, ensuring effective image management.

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
imageYesIf the customer provides the picture editing operation of the attachment,please send it to the corresponding tool,otherwise, pass an empty string
messageYesTranslate into English and explain the content of the customer's image.

Implementation Reference

  • The execute method that implements the tool's core logic: sends a POST request to /api/image with message and image, returns the response or error.
    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 input schema for the tool defining 'message' and 'image' string parameters.
    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 with the MCP server.
    new CreateImageTool().register(server);
  • src/index.ts:6-6 (registration)
    Imports the CreateImageTool class.
    import { CreateImageTool } from "./tools/create-image";
  • BaseTool's register method that wires the tool name, description, schema, and execute handler to the MCP server.
    register(server: McpServer) { server.tool( this.name, this.description, this.schema.shape, this.execute.bind(this) ); }

Other Tools

Related 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