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();
Behavior3/5

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

With no annotations provided, the description carries the full burden. It clearly indicates this is a read operation ('Get information') and specifies the scope ('in this session'), but doesn't disclose potential limitations like what happens if no image exists, error conditions, or session persistence details. It adds some context about the tool's role in the workflow.

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 perfectly concise with two sentences that each serve distinct purposes: the first defines what the tool does, the second explains when to use it. There's zero wasted text, and the most important information (the tool's purpose) is front-loaded.

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?

For a zero-parameter tool with no annotations and no output schema, the description provides good context about what information is retrieved and how it fits into the workflow with 'continue_editing'. However, it doesn't specify the exact format of returned information or what 'etc.' might include, leaving some ambiguity about the output.

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 tool has zero parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, and instead focuses on the tool's purpose and usage context.

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 specific action ('Get information about') and resource ('last generated/edited image'), including what information is retrieved ('file path, size, etc.'). It explicitly distinguishes this tool from its sibling 'continue_editing' by explaining its role in checking what image is available for that operation.

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?

The description provides explicit guidance on when to use this tool ('to check what image is currently available for continue_editing'), directly naming the sibling tool 'continue_editing' as the alternative for which this serves as a prerequisite check. This creates clear contextual boundaries.

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

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