Skip to main content
Glama

Attach Image To Page

media_attach

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).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "pageId": "<pageId>",
      "mediaAssetId": "<mediaAssetId>",
      "placement": "<placement>"
    },
    "name": "media_attach"
  }
}

Input 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

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

A3.6/5.0
Behavior3/5

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

Annotations already declare the safety profile (readOnlyHint=false, destructiveHint=false, openWorldHint=false, idempotentHint=false), lowering the bar. The description adds one genuinely behavioral detail — gallery_item appends and falls back to the first gallery when blockId is absent — but says nothing about duplicate attachments on repeat calls (non-idempotent) or what happens when a placement already holds an asset.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence followed by a compact placement breakdown; nothing is wasted. The nested parentheticals are dense but each clause carries a distinct rule, so the length is justified rather than padding.

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?

An output schema exists, so return values need no explanation, and the schema documents all six parameters including editToken and altText. For a moderate-complexity attach operation, the description plus structured fields cover everything needed to invoke it correctly; only repeat-call semantics remain unstated, which is a marginal gap.

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 baseline is 3. The description's placement parenthetical largely restates the enum descriptions already in the schema, adding only the 'otherwise the first one is used' default for gallery_item. It also omits two enum values present in the schema (header_photo and unassigned), so it does not fully supersede the structured field.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Attach a ready media asset to the page.' The qualifier 'ready' implicitly distinguishes it from media_upload / media_upload_link_create, which produce assets rather than consume them. It stops short of naming those siblings explicitly, so the differentiation is inferential rather than stated.

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

Usage Guidelines3/5

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

Usage context is implied rather than declared: pageId 'returned by page_create' and mediaAssetId 'returned by media_upload' establish the prerequisite chain, and the placement breakdown routes the agent to the right mode. However, there is no explicit statement of when to choose this over uploading, and no warning about calling it twice for the same placement.

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