Skip to main content
Glama

get_last_image_info

Retrieve details about the most recent image created or modified in your current session, including file path and size information.

Instructions

Get information about the last generated/edited image in this session (file path, size, etc.). Use this to check what image is currently available for continue_editing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'get_last_image_info' tool. It checks if there is a last image path, verifies if the file exists, and returns details like path, file size, and last modified time, or appropriate messages if no image or file not found.
    private async getLastImageInfo(): Promise<CallToolResult> { if (!this.lastImagePath) { return { content: [ { type: "text", text: "📷 No previous image found.\n\nPlease generate or edit an image first, then this command will show information about your last image.", }, ], }; } // 检查文件是否存在 try { await fs.access(this.lastImagePath); const stats = await fs.stat(this.lastImagePath); return { content: [ { type: "text", text: `📷 Last Image Information:\n\nPath: ${this.lastImagePath}\nFile Size: ${Math.round(stats.size / 1024)} KB\nLast Modified: ${stats.mtime.toLocaleString()}\n\n💡 Use continue_editing to make further changes to this image.`, }, ], }; } catch { return { content: [ { type: "text", text: `📷 Last Image Information:\n\nPath: ${this.lastImagePath}\nStatus: ❌ File not found\n\n💡 The image file may have been moved or deleted. Please generate a new image.`, }, ], }; } }
  • src/index.ts:162-170 (registration)
    Registration of the 'get_last_image_info' tool in the listTools response, including name, description, and input schema (no parameters required).
    { name: "get_last_image_info", description: "Get information about the last generated/edited image in this session (file path, size, etc.). Use this to check what image is currently available for continue_editing.", inputSchema: { type: "object", properties: {}, additionalProperties: false, }, },
  • Dispatch case in the main CallToolRequest handler that routes the tool call to the getLastImageInfo method.
    case "get_last_image_info": return await this.getLastImageInfo();

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/WeiYu021/openrouter-image-MCP'

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