Skip to main content
Glama

continue_editing

Modify the most recent image in your session by describing changes or using reference images for iterative improvements.

Instructions

Continue editing the LAST image that was generated or edited in this session, optionally using additional reference images. Use this for iterative improvements, modifications, or changes to the most recent image. This automatically uses the previous image without needing a file path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesText describing the modifications/changes/improvements to make to the last image (e.g., 'change the hat color to red', 'remove the background', 'add flowers')
referenceImagesNoOptional array of file paths to additional reference images to use during editing (e.g., for style transfer, adding elements from other images, etc.)

Implementation Reference

  • The main handler function for the 'continue_editing' tool. It checks configuration and last image existence, then delegates to the 'edit_image' tool using the last image path.
    private async continueEditing(request: CallToolRequest): Promise<CallToolResult> {
      if (!this.ensureConfigured()) {
        throw new McpError(ErrorCode.InvalidRequest, "Gemini API token not configured. Use configure_gemini_token first.");
      }
    
      if (!this.lastImagePath) {
        throw new McpError(ErrorCode.InvalidRequest, "No previous image found. Please generate or edit an image first, then use continue_editing for subsequent edits.");
      }
    
      const { prompt, referenceImages } = request.params.arguments as { 
        prompt: string; 
        referenceImages?: string[];
      };
    
      // 检查最后的图片文件是否存在
      try {
        await fs.access(this.lastImagePath);
      } catch {
        throw new McpError(ErrorCode.InvalidRequest, `Last image file not found at: ${this.lastImagePath}. Please generate a new image first.`);
      }
    
      // Use editImage logic with lastImagePath
      
      return await this.editImage({
        method: "tools/call",
        params: {
          name: "edit_image",
          arguments: {
            imagePath: this.lastImagePath,
            prompt: prompt,
            referenceImages: referenceImages
          }
        }
      } as CallToolRequest);
    }
  • The tool schema definition including name, description, and input schema for 'continue_editing'.
      name: "continue_editing",
      description: "Continue editing the LAST image that was generated or edited in this session, optionally using additional reference images. Use this for iterative improvements, modifications, or changes to the most recent image. This automatically uses the previous image without needing a file path.",
      inputSchema: {
        type: "object",
        properties: {
          prompt: {
            type: "string",
            description: "Text describing the modifications/changes/improvements to make to the last image (e.g., 'change the hat color to red', 'remove the background', 'add flowers')",
          },
          referenceImages: {
            type: "array",
            items: {
              type: "string"
            },
            description: "Optional array of file paths to additional reference images to use during editing (e.g., for style transfer, adding elements from other images, etc.)",
          },
        },
        required: ["prompt"],
      },
    },
  • src/index.ts:168-170 (registration)
    The dispatch case in the CallToolRequest handler that routes calls to the continueEditing method.
    case "continue_editing":
      return await this.continueEditing(request);
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 key behavioral traits: it's a mutation tool (editing implies changes), it tracks session state ('LAST image in this session'), and it has automatic referencing. However, it lacks details on permissions, rate limits, error conditions, or what happens if no previous image exists, leaving gaps for a mutation tool.

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 front-loaded with the core purpose in the first sentence, followed by usage context and a key behavioral note. Every sentence adds value without redundancy, making it efficient and well-structured for quick understanding.

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 moderate complexity (mutation with session state) and no annotations or output schema, the description does well by covering purpose, usage, and key behavior. However, it lacks details on return values, error handling, or session management specifics, which would be helpful for full completeness.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already fully documents both parameters. The description adds no additional meaning beyond what the schema provides, such as examples or edge cases for parameters. Baseline 3 is appropriate when the schema does all the heavy lifting.

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 ('continue editing'), target resource ('the LAST image that was generated or edited in this session'), and scope ('iterative improvements, modifications, or changes'). It distinguishes from sibling tools like 'edit_image' by emphasizing it works on the most recent image automatically without file paths.

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 explicitly states when to use this tool ('for iterative improvements, modifications, or changes to the most recent image') and distinguishes it from alternatives by noting it 'automatically uses the previous image without needing a file path,' which contrasts with tools like 'edit_image' that likely require explicit file references.

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