Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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();
  • Input schema for the get_last_image_info tool: an empty object (no parameters required).
    inputSchema: {
      type: "object",
      properties: {},
      additionalProperties: false,
    },
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses that the tool retrieves information (e.g., file path, size) about the last image in the session, which implies read-only behavior, but lacks details on error handling, session scope, or data freshness. This is adequate but with gaps in behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with zero waste: the first states the purpose, and the second provides usage guidance. It is front-loaded with essential information and appropriately sized for the tool's simplicity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (0 parameters, no annotations, no output schema), the description is nearly complete: it explains what the tool does and when to use it. However, it lacks details on output format (e.g., what 'etc.' includes) and potential errors, which could be improved for full completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately adds no parameter details, maintaining focus on the tool's purpose and usage, which aligns with the baseline for zero parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Get information about') and resources ('last generated/edited image'), distinguishing it from siblings like 'generate_image' or 'edit_image' by focusing on retrieval of metadata rather than image creation or modification.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly states when to use this tool ('to check what image is currently available for continue_editing'), providing clear context and distinguishing it from alternatives by linking directly to the 'continue_editing' sibling tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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