Skip to content
On this page · 17 sections
  1. list_media
  2. get_media
  3. upload_media
  4. upload_media_from_url
  5. update_media
  6. replace_media
  7. list_media_folders
  8. create_media_folder
  9. rename_media_folder
  10. move_media_folder
  11. delete_media_folder
  12. move_media
  13. duplicate_media
  14. get_media_usages
  15. trash_media
  16. restore_media
  17. delete_trashed_media
Docs

MCP: media and fonts

Updated

The MCP tools for the media library (images and videos, folders, alt text) and the website's uploaded fonts.

The media library holds the website's images and videos. Image and video fields and settings take a file's uuid. These tools add, describe, organise, replace and remove files and fonts.

This page lists 17 tools. How to read each entry, the website argument, permissions, publishing, errors and limits are on MCP reference.

list_media

List the website's media library (images and videos), a page at a time, newest first. Filter by "type" ("svg" for SVG images alone), by "folder_id" (0 for the top level; left out, every folder), find by "search" in the file name, or sort by "oldest" or "name". "status": "trash" lists the trash instead, most recently trashed first (restore_media brings one back). An entry's image or video field and a theme's image or video setting take a file's "uuid", not its "url" (an address there shows nothing); the "url" is for what takes an address, such as a share image (ogImage).

  • Permission: Media · View
  • Read-only
Argument Type Required Description
type string No Only images (SVG included), only videos, or only SVG images. (one of image, video, svg)
folder_id integer No Only the files directly in this folder (list_media_folders); left out, every folder. 0 is the top level. (min 0)
status string No "live" (default), or "trash" for the files in the trash. (one of live, trash)
search string No Only files whose name contains this text.
sort string No "newest" (default), "oldest" or "name". (one of newest, oldest, name)
page integer No The page to read, from 1. Default 1. (min 1)
per_page integer No How many items a page holds, at most 100. Default 25. (min 1; max 100)

get_media

Read one media file (image or video) by its uuid: its name, size, dimensions, URL, thumbnail and alt text per language.

  • Permission: Media · View
  • Read-only
Argument Type Required Description
uuid string Yes The media file's uuid, as list_media answers it.

upload_media

Upload an image or video (up to 10 MB) to the media library from its bytes in base64. Images: jpeg, png, gif, svg, webp, bmp, tiff; videos: mp4, mov, avi, wmv, flv, mkv, webm. Answers the stored file with its URL. Live at once.

  • Permission: Media · Edit
Argument Type Required Description
filename string Yes The file's name with its extension, e.g. "team-photo.jpg".
data_base64 string Yes The file's bytes in base64, without a "data:" prefix, at most 10 MB decoded.

upload_media_from_url

Download an image or video (up to 10 MB) from a public http(s) address into the media library, optionally with its alt text per language. Redirects are not followed: give the address the file is served from. Answers the stored file with its URL. Live at once.

  • Permission: Media · Edit
  • Reaches outside in1s
Argument Type Required Description
url string Yes The file's public http or https address.
alt object No See below the table.
  • alt: The text describing the image to people who cannot see it, at most 125 characters per language; leave it out for a decorative image (site health then lists the image as having no alt text). Per language: {"l10n": true, "<locale>": "<text>"}. On an update only the languages you give change: the others are kept, and a language given as null is removed.

update_media

Change a media file's alt text (per language, at most 125 characters, or empty for a decorative image), its name in the library, or an image's focal point (the spot a crop keeps in view; null clears it). Only the arguments you give change; the file and its URL stay as they are. Live at once.

  • Permission: Media · Edit
Argument Type Required Description
uuid string Yes The media file's uuid, as list_media answers it.
alt object No The text describing the image to people who cannot see it, at most 125 characters; an empty text marks the image decorative. Per language: {"l10n": true, "<locale>": "<text>"}. On an update only the languages you give change: the others are kept, and a language given as null is removed.
name string No The file's name in the library (a label only: the URL does not change).
focal_point object, or null No An image's focal point, which themes read as image.presentation.focal_point; null clears it.
focal_point.x number Yes Percent of the width, from the left. (min 0; max 100)
focal_point.y number Yes Percent of the height, from the top. (min 0; max 100)

replace_media

Replace the file of a media item (its uuid from list_media) with new bytes in base64, up to 10 MB, keeping its uuid: every page, entry and setting that shows it shows the new file at once, at a new URL. An image is replaced by an image, a video by a video. Images: jpeg, png, gif, svg, webp, bmp, tiff; videos: mp4, mov, avi, wmv, flv, mkv, webm. Answers the media file with its new URL.

  • Permission: Media · Edit
Argument Type Required Description
uuid string Yes The media file's uuid, as list_media answers it.
filename string Yes The file's name with its extension, e.g. "team-photo.jpg".
data_base64 string Yes The file's bytes in base64, without a "data:" prefix, at most 10 MB decoded.

list_media_folders

List the media library's folders inside the folder "parent_id" (0, or left out, for the top level), a page at a time, by name. Each folder has its id, name, parentId, filesCount and foldersCount. Folders only organise the library: a file's URL never depends on its folder. Use list_media with "folder_id" to list a folder's files.

  • Permission: Media · View
  • Read-only
Argument Type Required Description
parent_id integer No The folder whose folders to list; left out, the top level. 0 is the top level. (min 0)
page integer No The page to read, from 1. Default 1. (min 1)
per_page integer No How many items a page holds, at most 100. Default 25. (min 1; max 100)

create_media_folder

Create a folder in the media library, inside the folder "parent_id" (0, or left out, for the top level). A name is unique among its neighbours ignoring case and accents, and folders go at most 5 levels deep. Answers the folder; move files into it with move_media.

  • Permission: Media · Edit
Argument Type Required Description
name string Yes The folder's name, 1 to 120 characters.
parent_id integer No The folder to create it in; left out, the top level. 0 is the top level. (min 0)

rename_media_folder

Rename a media library folder by its id. Nothing that uses its files changes: a folder is never part of a URL. A name is unique among its neighbours ignoring case and accents.

  • Permission: Media · Edit
Argument Type Required Description
id integer Yes The folder's id, as list_media_folders answers it. (min 1)
name string Yes The new name, 1 to 120 characters.

move_media_folder

Move a media library folder, with its files and folders, into the folder "parent_id" (required; 0 for the top level). Refused into itself or a folder inside it, or past 5 levels deep. No URL changes.

  • Permission: Media · Edit
Argument Type Required Description
id integer Yes The folder's id, as list_media_folders answers it. (min 1)
parent_id integer Yes The folder to move it into. 0 is the top level. (min 0)

delete_media_folder

Delete an empty media library folder by its id. A folder that still holds a folder or a file is refused: move or trash what is in it first. A file in the trash that sat in it is restored to the top level.

  • Permission: Media · Delete
  • Destructive
Argument Type Required Description
id integer Yes The folder's id, as list_media_folders answers it. (min 1)

move_media

Move media files, by their uuids (at most 100), into the library folder "folder_id" (required; 0 for the top level). All or none. A file's URL never changes, so nothing that uses it changes.

  • Permission: Media · Edit
Argument Type Required Description
uuids array of string Yes The files' uuids, as list_media answers them. (at least 1 items; at most 100 items)
folder_id integer Yes The folder to move them into. 0 is the top level. (min 0)

duplicate_media

Copy an image or video as a new file named "... copy", in the same folder with the same alt text: a new uuid and a new URL, counted toward the plan's storage like an upload. Use it before changing a file you do not want to change everywhere it is used.

  • Permission: Media · Edit
Argument Type Required Description
uuid string Yes The media file's uuid, as list_media answers it.

get_media_usages

List where a media file is used, a page at a time: theme files (published, or only in the unpublished draft), data list entries, data lists, forms, workflows, the website settings and SEO images. "hidden" counts places your access cannot open; "truncated" or "partial" mean the search did not reach every place. Read it before trash_media.

  • Permission: Media · View
  • Read-only
Argument Type Required Description
uuid string Yes The media file's uuid, as list_media answers it.
page integer No The page to read, from 1. Default 1. (min 1)
per_page integer No How many items a page holds, at most 100. Default 25. (min 1; max 100)

trash_media

Move a media file to the trash. Every page, setting and field that uses it by its uuid shows nothing in its place at once; its URL keeps working where it is stored as an address (an SEO image, a pasted link) until it is deleted for good, 30 days later. restore_media brings it back until then. Check get_media_usages first.

  • Permission: Media · Delete
  • Destructive
Argument Type Required Description
uuid string Yes The media file's uuid, as list_media answers it.

restore_media

Bring a media file back from the trash by its uuid (list_media with status "trash" lists them): every use of it shows it again at once. It returns to its folder, or to the top level when that folder was deleted.

  • Permission: Media · Delete
Argument Type Required Description
uuid string Yes The media file's uuid, as list_media answers it.

delete_trashed_media

Delete a media file that is in the trash for good, by its uuid (list_media with status "trash" lists them): the stored file is removed, so its URL stops working everywhere it was pasted. A live file is refused: move it to the trash first with trash_media. This cannot be undone. Only do this when the person asked you to delete it for good.

  • Permission: Media · Delete
  • Destructive
Argument Type Required Description
uuid string Yes The media file's uuid, as list_media answers it.

Start typing to search the docs.