Skip to main content
Glama

compute_image_crops

Generate image crop coordinates for Meta ad creatives. Input image width and height (and optional crop keys) to receive a ready-to-use image_crops dict for various placements.

Instructions

Compute image_crops coordinates for a source image of the given dimensions.

Returns the image_crops dict ready to pass directly to create_ad_creative
or bulk_create_ad_creatives. For each crop key the result is the largest
centered region that fits within the source image while matching the key's
aspect ratio — equivalent to "Original" crop (no content is cut off beyond
what the ratio requires).

Args:
    image_width: Width of the source image in pixels (e.g. 1080).
    image_height: Height of the source image in pixels (e.g. 1080).
    crop_keys: Optional list of specific crop keys to compute. Defaults to
        all 6 keys accepted by Meta's API:
          "100x100"  — 1:1 square (Feed, Marketplace, Search)
          "100x72"   — ~1.39:1 horizontal (Marketplace, some placements)
          "400x500"  — 4:5 portrait (Feed on mobile, Stories fallback)
          "400x150"  — ~2.67:1 wide banner (Audience Network)
          "600x360"  — ~1.67:1 horizontal (Right column, some placements)
          "90x160"   — 9:16 tall portrait (Stories)

Returns:
    JSON with the image_crops dict (ready for copy-paste into create_ad_creative),
    plus validation notes for any invalid keys requested.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
image_widthYes
image_heightYes
crop_keysNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It describes the algorithm (largest centered region matching aspect ratio, equivalent to 'Original' crop) and notes validation for invalid keys. It does not mention rate limits or auth, but those are likely standard and not hidden.

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 well-structured with clear Args and Returns sections, is concise, and includes examples. Every sentence adds value with no redundancy.

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

Completeness5/5

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

Given the tool has 3 parameters, an output schema, and is a preparatory helper, the description fully explains the input, output format, and usage. It mentions validation and provides a ready-to-use result, making it complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must add meaning for all parameters. It does: image_width/height are pixels with examples, crop_keys is optional and defaults to all 6 keys with explanations. This fully compensates for the lack of schema descriptions.

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 it computes crop coordinates for a source image of given dimensions, using the specific verb 'compute' and explicitly linking the output to 'create_ad_creative' or 'bulk_create_ad_creatives'. This distinguishes it from sibling tools like those that actually create ads.

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

Usage Guidelines4/5

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

The description tells the agent to use this tool before creating ad creatives to get the crop coordinates. It implies it is a preparatory step but does not explicitly state when not to use or mention alternatives, though the context is clear.

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/pipeboard-co/meta-ads-mcp'

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