Skip to main content
Glama

Attach Image To Page

media_attach
Idempotent

Attach a ready media asset to the page. placement determines where: avatar (header), block_image (image inside a specific block — requires blockId), gallery_item (appended to a gallery — optional blockId targets a specific gallery; otherwise the first one is used), background (theme background).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageIdYesThe pageId returned by page_create.
altTextNoMeaningful alt text for the image.
blockIdNoRequired when placement is block_image; optional for gallery_item (targets a specific gallery block).
editTokenNoRequired for anonymous demo pages. Use the editToken returned by page_create.
placementYesWhere the image should be used. header_photo = business-card top photo, avatar = profile header avatar, block_image = image inside a block (requires blockId), gallery_item = appended to a gallery block, background = page background.
mediaAssetIdYesThe mediaAssetId returned by media_upload or media_upload_link_create.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
urlNo
pageIdNo
statusYes
altTextYes
contentNo
attachedNo
nextStepNo
variantsNo
deletedAtNo
expiresAtNo
placementYes
revisionIdNo
uploadedAtNo
mediaAssetIdYes
uploadPageUrlNo
revisionVersionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare this is a mutating (readOnly=false), idempotent, non-destructive operation. The description adds useful placement behavior: gallery_item is appended and falls back to the first gallery when no blockId is given. It does not contradict the annotations.

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?

One dense sentence with the core action first, followed by placement semantics; no filler. The semicolon-separated list earns its place.

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?

The rich schema, output schema, and annotations cover parameters and safety, so the description need only provide the core workflow. It omits header_photo and unassigned placements, but those are fully enumerated in the schema; overall the agent has enough to invoke correctly.

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 coverage, the schema already documents all six parameters. The description adds a little extra placement/blockId behavior ('otherwise the first one is used') but mostly paraphrases the schema, so the baseline 3 is appropriate.

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 opening phrase 'Attach a ready media asset to the page' names a specific action, an existing media resource, and a target page, and 'ready' distinguishes it from media_upload/media_delete. The placement explanations further clarify the resource scope.

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 establishes when to use the tool by requiring a 'ready' asset and explaining placement-specific constraints such as blockId being required for block_image and optional for targeting a gallery. It does not explicitly name sibling tools, but the context and schema references to media_upload/media_upload_link_create make the intended workflow clear.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources