get_image
Retrieve details of a previously generated image using its unique ID. This tool allows users to access image metadata and status from the RendrKit AI design platform.
Instructions
Get details of a previously generated image
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The image ID |
Implementation Reference
- src/tools/get-image.ts:5-58 (handler)Main implementation of the get_image tool. Contains the registerGetImageTool function that registers the tool with the MCP server, defines the input schema (id: string), and implements the async handler logic that calls client.getImage() and formats the response as text with image details.
export function registerGetImageTool( server: McpServer, client: RendrKitClient, ): void { server.registerTool( "get_image", { description: "Get details of a previously generated image", inputSchema: { id: z.string().describe("The image ID"), }, }, async ({ id }) => { try { const image = await client.getImage(id); return { content: [ { type: "text" as const, text: [ `Image Details`, ``, `URL: ${image.url}`, `ID: ${image.id}`, `Size: ${image.width}x${image.height}`, `Style: ${image.style}`, `Prompt: ${image.prompt}`, image.brandKitId ? `Brand Kit: ${image.brandKitId}` : null, `Created: ${image.createdAt}`, ] .filter(Boolean) .join("\n"), }, ], }; } catch (error) { const message = error instanceof Error ? error.message : String(error); return { content: [ { type: "text" as const, text: `Failed to get image: ${message}`, }, ], isError: true, }; } }, ); } - src/tools/get-image.ts:13-15 (schema)Input schema definition for the get_image tool using Zod validation. Defines a single required 'id' parameter of type string with a description.
inputSchema: { id: z.string().describe("The image ID"), }, - src/server.ts:19-19 (registration)Registration of the get_image tool in the server initialization. Calls registerGetImageTool to register the tool with the MCP server instance.
registerGetImageTool(server, client); - src/api-client.ts:97-99 (helper)Helper method that performs the actual API request. Makes a GET request to /api/v1/images/{id} endpoint and returns the ImageDetails response.
async getImage(id: string): Promise<ImageDetails> { return this.request<ImageDetails>("GET", `/api/v1/images/${id}`); } - src/types.ts:15-24 (schema)Type definition for ImageDetails interface. Defines the structure of the API response including id, url, width, height, prompt, style, optional brandKitId, and createdAt fields.
export interface ImageDetails { id: string; url: string; width: number; height: number; prompt: string; style: string; brandKitId?: string; createdAt: string; }