Skip to main content
Glama

get_last_image_info

Retrieve details of the most recent image generated or edited in the current session, including file path and size, to identify available images for continued editing operations.

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

  • src/index.ts:140-148 (registration)
    Tool registration in the ListToolsRequestSchema handler, including name, description, and input schema (no required parameters).
    { 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, }, },
  • The core handler function for 'get_last_image_info' tool. Checks if lastImagePath exists, retrieves file stats (size, mtime), and returns formatted text with path, size, and modification time, or error messages if no image or file missing.
    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.`, }, ], }; } }
  • Dispatch case in the CallToolRequestSchema 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/ConechoAI/Nano-Banana-MCP'

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