Skip to main content
Glama

Import a file onto a page (import)

import_attachment
Idempotent

Upload a local file or URL as an attachment to an imported page under a chosen uuid, idempotent by source_id. Use after import_create_space to migrate Confluence attachments.

Instructions

Needs a token with the import:write scope whose owner is a global admin. Nothing is emailed or notified, and no per-row audit events are written. Only works in a space created with import_create_space (otherwise 403 IMPORT_SPACE_NOT_IMPORTED). Upload a file to an imported page under the uuid you chose (the one written in the body as ![name](attachment:<uuid>); by default derived from source_id, see import_ids). Give exactly one source: path (a local file) or url (downloaded to a temporary file with a size cap; for URLs on ATLASSIAN_SITE_URL it signs in with ATLASSIAN_EMAIL + ATLASSIAN_API_TOKEN, and those credentials are never sent to any other host, redirects included). Idempotent by source_id. Run import_check_page afterwards to find files that are still missing. The server decides the accepted types and says so when it refuses one.

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": {
      "page_id": "<page_id>",
      "source_id": "<source_id>",
      "uploaded_by_user_id": "<uploaded_by_user_id>",
      "created_at": "<created_at>"
    },
    "name": "import_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoThe attachment uuid written in the body. Defaults to the deterministic id import_ids gives for source_id.
urlNoA URL to download (a Confluence attachment URL, for instance).
pathNoAbsolute path of a local file.
page_idYesSophia page id (uuid), from get_page_tree, search_pages or recent_pages.
file_nameNoDefaults to the name in the path or URL.
source_idYesThe id of this attachment in Confluence. Importing the same source id again changes nothing.
created_atYesISO 8601 date-time, e.g. 2023-05-02T10:11:12.000Z.
content_typeNoDefaults to what the server or the extension says.
uploaded_by_user_idYesSophia user id (uuid) from import_find_users or import_ensure_user.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes well past the annotations (which only cover readOnly=false, openWorld, idempotent, non-destructive): it discloses the required scope and admin ownership, that nothing is emailed or notified and no per-row audit events are written, the exact failure code, the idempotency key, URL size caps, and that ATLASSIAN credentials are never sent to other hosts including via redirects. The accepted-type behavior is also flagged as server-decided with an explicit refusal message.

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?

Every sentence carries operational information and there is no filler, but the auth-scope sentence leads while the core action appears second, and several sentences are dense multi-clause parentheticals. Slightly better ordering and splitting would improve scanability without losing content.

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?

For a 9-parameter mutation tool with no output schema, the definition covers permissions, failure modes, idempotency, source exclusivity, and a follow-up verification step. The one remaining gap is that it never hints at what a successful call returns (id, url, or status), which the agent must discover empirically.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds genuinely new meaning: it explains how the attachment uuid is referenced in the page body (`![name](attachment:<uuid>)`), that it defaults deterministically from source_id via import_ids, and that path and url are mutually exclusive, a constraint the schema itself does not encode.

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?

States a concrete verb and resource – uploading a file to an imported page under a chosen attachment uuid – and scopes it to pages in spaces built by import_create_space. An agent can distinguish it from the generic upload_attachment because the import-space prerequisite and the source_id/import_ids machinery are named.

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

Usage Guidelines5/5

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

Gives explicit preconditions (import:write token owned by a global admin, space must have been created by import_create_space or a 403 IMPORT_SPACE_NOT_IMPORTED results), an explicit post-step (run import_check_page to find still-missing files), and an explicit selection rule between the two source parameters ('exactly one source: path or url').

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