Ragex.MCP.Handlers.ImageTools (Ragex v0.28.0)

View Source

MCP tool definitions and handlers for image operations backed by the Image library.

Provides 10 tools:

  • image_info -- Extract metadata, dimensions, color space, EXIF, and format details
  • image_resize -- Resize image by scale factor, width, height, or thumbnail bounding box
  • image_crop -- Crop an image by bounding box or auto-trim whitespace/borders
  • image_rotate -- Rotate by angle or flip image horizontally/vertically
  • image_convert -- Convert image format (PNG, JPEG, WebP, AVIF, TIFF, GIF)
  • image_apply_filter -- Apply visual filter (grayscale, blur, sharpen, brightness, contrast, invert, sepia, etc.)
  • image_composite -- Overlay an image onto another at coordinates (x, y) with opacity
  • image_compare -- Compare two images for difference/similarity and generate visual diff
  • image_avatar -- Create a circular, squircle, or square avatar image
  • image_draw_text -- Render text overlay onto an image at specified position

Summary

Functions

Dispatch an image tool call. Returns {:ok, result} or {:error, reason}.

Returns the list of image tool definitions for tools/list.

Functions

call_tool(name, arguments)

Dispatch an image tool call. Returns {:ok, result} or {:error, reason}.

tool_definitions()

Returns the list of image tool definitions for tools/list.