get_last_image_info
Retrieve details about the most recent image in your session, including file path and size, to identify available images for editing.
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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:520-554 (handler)The handler function that implements the get_last_image_info tool. It checks if a last image path exists, verifies the file, retrieves stats, and returns formatted information or appropriate 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.`, }, ], }; } - src/index.ts:140-148 (registration)Registration of the 'get_last_image_info' tool in the MCP tools array, including name, description, and empty input schema.
{ 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, }, }, - src/index.ts:171-172 (registration)Switch case in the main CallToolRequest handler that dispatches calls to the getLastImageInfo method.
case "get_last_image_info": return await this.getLastImageInfo(); - src/index.ts:143-147 (schema)Input schema for the get_last_image_info tool: an empty object (no parameters required).
inputSchema: { type: "object", properties: {}, additionalProperties: false, },