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'] } },

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