Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYesThe image ID

Implementation Reference

  • 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,
            };
          }
        },
      );
    }
  • 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);
  • 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}`);
    }
  • 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;
    }

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/vbiff/rendr-kit'

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