Skip to main content
Glama

describe_region

Analyze specific image regions by cropping to bounding boxes and generating detailed descriptions. Use after object detection to focus on particular elements.

Instructions

Crop an image to a bounding box and describe that region in detail. Use this after detect() to zoom in on specific objects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imageYesPath to the image file
bboxYesBounding box as [ymin, xmin, ymax, xmax] normalized 0-1000
promptNoOptional question or instruction for the description
providerNoVision provider to use (default: gemini)

Implementation Reference

  • The handler function `handleDescribeRegion` that crops the image to the specified bounding box using `cropToRegion`, encodes it to base64, and generates a detailed description using the selected vision provider (gemini, openai, or claude). Returns a structured response with bbox and description.
    export async function handleDescribeRegion(args: Record<string, unknown>) {
      const image = args.image as string;
      const bbox = args.bbox as [number, number, number, number];
      const prompt = args.prompt as string | undefined;
      const provider = (args.provider as Provider) || "gemini";
    
      // Crop to region
      const { buffer } = await cropToRegion(image, bbox);
      const base64 = buffer.toString("base64");
      const mimeType = "image/png";
    
      let description: string;
    
      switch (provider) {
        case "gemini":
          description = await geminiDescribe(base64, mimeType, prompt, "detailed");
          break;
        case "openai":
          description = await openaiDescribe(base64, mimeType, prompt, "detailed");
          break;
        case "claude":
          description = await claudeDescribe(base64, mimeType, prompt, "detailed");
          break;
        default:
          throw new Error(`Unknown provider: ${provider}`);
      }
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              {
                bbox,
                description,
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • The tool definition `describeRegionTool` including name, description, and input schema specifying required `image` and `bbox` parameters, optional `prompt` and `provider`.
    export const describeRegionTool: Tool = {
      name: "describe_region",
      description:
        "Crop an image to a bounding box and describe that region in detail. Use this after detect() to zoom in on specific objects.",
      inputSchema: {
        type: "object",
        properties: {
          image: {
            type: "string",
            description: "Path to the image file or URL (http/https)",
          },
          bbox: {
            type: "array",
            items: { type: "number" },
            minItems: 4,
            maxItems: 4,
            description:
              "Bounding box as [ymin, xmin, ymax, xmax] normalized 0-1000",
          },
          prompt: {
            type: "string",
            description: "Optional question or instruction for the description",
          },
          provider: {
            type: "string",
            enum: ["gemini", "openai", "claude"],
            description: "Vision provider to use (default: gemini)",
          },
        },
        required: ["image", "bbox"],
      },
    };
  • src/index.ts:58-59 (registration)
    Registration of the `describe_region` tool handler in the main switch statement for tool calls.
    case "describe_region":
      return await handleDescribeRegion(args);
  • src/index.ts:42-42 (registration)
    Registration of the `describeRegionTool` schema in the list of available tools returned by ListToolsRequestHandler.
    describeRegionTool,
  • src/index.ts:21-21 (registration)
    Import of the tool schema and handler from the implementation file.
    import { describeRegionTool, handleDescribeRegion } from "./tools/describe-region.js";
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains the core functionality (cropping and describing) and mentions a prerequisite relationship with detect(), but doesn't cover important behavioral aspects like error handling, performance characteristics, or what the detailed description output looks like. It provides basic context but lacks comprehensive behavioral transparency.

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 perfectly concise with just two sentences that each serve a distinct purpose: the first states what the tool does, the second provides usage guidance. There's zero wasted text, and the information is front-loaded with the core functionality stated immediately.

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 the tool's moderate complexity (image processing with multiple parameters) and the absence of both annotations and an output schema, the description provides adequate but incomplete context. It explains the purpose and usage relationship well, but doesn't address what the detailed description output contains or provide behavioral details that would be helpful for an AI agent to understand the tool fully.

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?

With 100% schema description coverage, the input schema already documents all 4 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema, so it meets the baseline expectation but doesn't provide additional semantic context about how parameters interact or affect the operation.

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 ('Crop an image to a bounding box and describe that region in detail') and distinguishes it from sibling tools by explicitly mentioning 'Use this after detect() to zoom in on specific objects.' This provides both the verb+resource combination and sibling differentiation.

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 provides explicit guidance on when to use this tool ('Use this after detect() to zoom in on specific objects') and implies alternatives by distinguishing it from the 'describe' sibling tool (which presumably describes entire images rather than cropped regions). This gives clear context for tool selection.

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/simen/mcp-see'

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