Skip to main content
Glama
pralayasimha23

meta-ads-mcp

compute_image_crops

Compute image crop coordinates for Meta Ads creatives. Provide image dimensions to generate a ready-to-use image_crops dict for ad creation.

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
crop_keysNo
image_widthYes
image_heightYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, the description carries the full burden and handles it well. It discloses the algorithm behavior (largest centered region matching aspect ratio, equivalent to 'Original' crop), the default set of crop keys with their aspect ratios and placements, and the inclusion of validation notes for invalid keys. This gives a complete picture of what happens during execution.

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 Args and Returns sections. Though it contains a detailed list of crop keys, every element adds value. The opening sentence provides an immediate summary, and no content is superfluous or redundant with schema.

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?

The tool has a small parameter set (3) and an output schema, so the description doesn't need to document return format in detail. It covers algorithm, defaults, parameter meanings, downstream usage, and error handling (validation notes), making it fully complete for an agent to use correctly.

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 description coverage is 0%, so the description fully compensates. It explains image_width and image_height with pixel units and examples, and details crop_keys as an optional list with the six defaults, each enriched with aspect ratio and placement context. This is far beyond schema basics.

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 begins with a clear, specific verb+resource combination: 'Compute image_crops coordinates for a source image of the given dimensions.' It uniquely identifies the tool's function, distinguishing it from all sibling tools which focus on ad/account management. No ambiguity about what the tool does.

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 explains the output is 'ready to pass directly to create_ad_creative or bulk_create_ad_creatives', which clearly signals when to use this tool (before creating ad creatives). However, it doesn't explicitly state when not to use it or mention alternatives, though none are apparent among siblings. The context is clear but not exhaustive.

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

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