Skip to main content
Glama

rotation-info

Extract image rotation and flip details using the exif-mcp server to accurately analyze orientation metadata for various image formats without external tools.

Instructions

Get detailed rotation and flip information from image orientation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imageYes

Implementation Reference

  • The handler function that executes the tool logic: loads the image buffer and uses exifr.rotation to retrieve rotation and flip information, returning it in a standardized response format or an error.
    async (args, extra) => { try { const { image } = args; const buf = await loadImage(image); const rotation = await exifr.rotation(buf); if (!rotation) { return createErrorResponse('No rotation metadata found in image'); } return createSuccessResponse(rotation); } catch (error) { return createErrorResponse(`Error reading rotation info: ${error instanceof Error ? error.message : String(error)}`); } }
  • The complete registration of the 'rotation-info' tool using server.tool, including name, description, input schema, handler function, and assignment to the tools registry.
    // Tool 9: rotation-info - gets rotation and flip information const rotationInfoTool = server.tool('rotation-info', "Get detailed rotation and flip information from image orientation", { image: ImageSourceSchema }, async (args, extra) => { try { const { image } = args; const buf = await loadImage(image); const rotation = await exifr.rotation(buf); if (!rotation) { return createErrorResponse('No rotation metadata found in image'); } return createSuccessResponse(rotation); } catch (error) { return createErrorResponse(`Error reading rotation info: ${error instanceof Error ? error.message : String(error)}`); } } ); tools['rotation-info'] = rotationInfoTool;
  • Zod schema defining the input structure for the image source parameter used by the rotation-info tool.
    const ImageSourceSchema = z.object({ kind: z.enum(['path', 'url', 'base64', 'buffer']), path: z.string().optional(), url: z.string().optional(), data: z.string().optional(), buffer: z.string().optional() });
  • src/server.ts:19-20 (registration)
    Top-level call to registerTools which includes the rotation-info tool among others.
    // Register all tools registerTools(server);

Other Tools

Related 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/stass/exif-mcp'

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