Skip to main content
Glama

upload_image

Upload an ad image from a public URL or local file to Meta Ads and return an image hash for ad creatives. Use a local file path if URL fetching is unsupported.

Instructions

Upload an ad image from a public URL or a local file. Returns image hash for use in ad creatives. Note: fetching from a URL requires the app to have Meta's URL-fetch capability — if that fails with an OAuthException 'Application does not have the capability to make this API call', use file_path to upload the raw bytes instead, which does not require that capability.

Input Schema

NameRequiredDescriptionDefault
urlNoPublic URL of the image to upload
nameNoName to assign to the uploaded image. Defaults to the file_path basename when uploading a local file.
file_pathNoLocal filesystem path of the image to upload. Sent as base64-encoded bytes, bypassing Meta's URL-fetch capability requirement.
account_idNoAd account ID to upload into (e.g. 'act_123' or '123'). Falls back to META_AD_ACCOUNT_ID env var if omitted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.6.1
    • addedInput schema / properties / account_id
      Added value: +{
      +  "description": "Ad account ID to upload into (e.g. 'act_123' or '123'). Falls back to META_AD_ACCOUNT_ID env var if omitted.",
      +  "type": "string"
      +}
    • addedInput schema / properties / file_path
      Added value: +{
      +  "description": "Local filesystem path of the image to upload. Sent as base64-encoded bytes, bypassing Meta's URL-fetch capability requirement.",
      +  "type": "string"
      +}
    • addedInput schema / properties / name
      Added value: +{
      +  "description": "Name to assign to the uploaded image. Defaults to the file_path basename when uploading a local file.",
      +  "type": "string"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "url"
      -]
  2. First observedv1.2.0

TDQS

A4.2/5.0
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 behavioral burden. It usefully discloses the return value (image hash), a Meta app capability requirement for URL fetching, and the exact failure mode that should trigger the file_path fallback. It does not cover file format/size limits or broader permission requirements, but it adds substantial operational context.

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 front-loaded with purpose, then return value, then the important fallback condition. Every sentence adds useful information without repetition.

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

Completeness4/5

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

There is no output schema, and the description supplies the key return value: the image hash. It also covers the main operational failure mode for URL uploads. It is nearly complete, though additional upload constraints such as supported formats or size limits would make it fully comprehensive.

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?

Schema description coverage is 100%, so the baseline is 3. The description reinforces the URL-versus-file_path distinction and the capability failure scenario, but it does not add meaning for name or account_id beyond what the schema already documents.

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 states a specific verb and resource: uploading an ad image from either a public URL or a local file. It also names the outcome (image hash for ad creatives), which clearly distinguishes it from sibling tools like list_images, get_image, delete_image, and upload_video.

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?

It gives an explicit condition for choosing file_path over url when URL fetching fails with a specific OAuthException. It does not provide broader guidance about when to use this tool instead of sibling tools, but the primary alternative path is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools