Skip to main content
Glama

flip_image

Flip images horizontally or vertically to correct orientation or create mirrored effects. Specify direction and paths to transform images with this editing tool.

Instructions

Flip an image horizontally or vertically

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputPathYesPath to input image
outputPathYesPath to save flipped image
directionYesFlip direction

Implementation Reference

  • Handler for flip_image tool: creates output dir, uses Sharp pipeline to flop (horizontal) and/or flip (vertical) based on direction, saves file, returns success message.
    case 'flip_image': {
      const { inputPath, outputPath, direction } = args;
      
      await fs.mkdir(path.dirname(outputPath), { recursive: true });
      
      let pipeline = sharp(inputPath);
      
      if (direction === 'horizontal' || direction === 'both') {
        pipeline = pipeline.flop();
      }
      if (direction === 'vertical' || direction === 'both') {
        pipeline = pipeline.flip();
      }
      
      await pipeline.toFile(outputPath);
      
      return {
        content: [
          {
            type: 'text',
            text: `Image flipped ${direction} successfully. Saved to: ${outputPath}`
          }
        ]
      };
    }
  • Input schema definition for flip_image tool, specifying inputPath, outputPath, and direction (horizontal, vertical, both).
    inputSchema: {
      type: 'object',
      properties: {
        inputPath: { type: 'string', description: 'Path to input image' },
        outputPath: { type: 'string', description: 'Path to save flipped image' },
        direction: {
          type: 'string',
          enum: ['horizontal', 'vertical', 'both'],
          description: 'Flip direction'
        }
      },
      required: ['inputPath', 'outputPath', 'direction']
    }
  • src/index.ts:138-154 (registration)
    Registration of the flip_image tool in the tools list returned by ListToolsRequestHandler.
    {
      name: 'flip_image',
      description: 'Flip an image horizontally or vertically',
      inputSchema: {
        type: 'object',
        properties: {
          inputPath: { type: 'string', description: 'Path to input image' },
          outputPath: { type: 'string', description: 'Path to save flipped image' },
          direction: {
            type: 'string',
            enum: ['horizontal', 'vertical', 'both'],
            description: 'Flip direction'
          }
        },
        required: ['inputPath', 'outputPath', 'direction']
      }
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the transformation but doesn't disclose behavioral traits like whether it modifies the original file, requires specific permissions, handles errors, supports image formats, or has performance implications. 'Flip an image' implies mutation but lacks details.

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 a single, efficient sentence with zero waste. It's front-loaded with the core action and appropriately sized for the tool's complexity.

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

Completeness3/5

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

Given no annotations and no output schema, the description is minimally complete for a simple transformation tool. It covers the basic purpose but lacks details on behavior, usage context, or output, leaving gaps that could hinder an agent's effective use.

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 documents all three parameters thoroughly. The description adds no additional meaning beyond what the schema provides, such as explaining the 'both' direction or path requirements, meeting the baseline for high coverage.

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 ('flip') and resource ('image'), and distinguishes from siblings by specifying the transformation type (horizontal/vertical/both) rather than other operations like resize, compress, convert, crop, get info, or rotate.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. While the purpose is clear, there's no mention of prerequisites, when flipping is appropriate versus other transformations, or any constraints on input/output paths.

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/flowy11/imagician'

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