display_generated_image
Display generated images in a new browser tab by providing the image URL. This tool visualizes AI-generated content for review and sharing.
Instructions
This function will display the generated image in a new tab
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| imageUrl | Yes | The URL of the generated image |
Implementation Reference
- src/tools/image-gen.ts:105-108 (handler)Core handler function that opens and displays the generated image URL using the 'open' library and logs the URL.export async function displayGeneratedImage(imageUrl: string): Promise<void> { await open(imageUrl); console.log(`Image displayed at ${imageUrl}`); }
- src/index.ts:267-269 (schema)Zod input schema defining the 'imageUrl' parameter as a required string.{ imageUrl: z.string().describe("The URL of the generated image"), },
- src/index.ts:264-281 (registration)MCP server tool registration for 'display_generated_image', including name, description, schema, and thin wrapper handler that invokes the core displayGeneratedImage function.server.tool( "display_generated_image", "This function will display the generated image in a new tab", { imageUrl: z.string().describe("The URL of the generated image"), }, async ({ imageUrl }) => { await displayGeneratedImage(imageUrl); return { content: [ { type: "text", text: `Image displayed at ${imageUrl}`, }, ], }; } );