Skip to main content
Glama

prismic_add_media

Upload media files to Prismic CMS with optional metadata like alt text, credits, and notes. Securely adds images or documents to your content repository using the Asset API.

Instructions

Upload media via Prismic Asset API.

Uploads file_path using multipart/form-data to POST /assets. Optional metadata maps to Asset API fields: notes, credits, alt. Requires PRISMIC_REPOSITORY and PRISMIC_WRITE_API_TOKEN. Security: PRISMIC_UPLOAD_ROOT must be set; upload paths must resolve within that directory (traversal and symlink escapes are blocked).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
notesNo
creditsNo
altNo

Implementation Reference

  • The handler function that performs the media upload logic by calling the service.
    async def handle_prismic_add_media(
        *,
        file_path: str,
        notes: str | None = None,
        credits: str | None = None,
        alt: str | None = None,
        service_factory: ServiceFactory = _build_service,
    ) -> dict[str, Any]:
        """Upload media to Prismic Asset API (`POST /assets`)."""
    
        async with service_factory() as service:
            media = await service.add_media(
                file_path=file_path,
                notes=notes,
                credits=credits,
                alt=alt,
            )
    
        return {"media": media}
  • The MCP tool registration for 'prismic_add_media' which delegates the execution to the handler.
    @server.tool(name="prismic_add_media")
    async def prismic_add_media(
        file_path: str,
        notes: str | None = None,
        credits: str | None = None,
        alt: str | None = None,
    ) -> dict[str, Any]:
        """Upload media via Prismic Asset API.
    
        Uploads `file_path` using `multipart/form-data` to `POST /assets`.
        Optional metadata maps to Asset API fields: `notes`, `credits`, `alt`.
        Requires `PRISMIC_REPOSITORY` and `PRISMIC_WRITE_API_TOKEN`.
        Security: `PRISMIC_UPLOAD_ROOT` must be set; upload paths must resolve
        within that directory (traversal and symlink escapes are blocked).
        """
    
        return await handle_prismic_add_media(

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rahulpowar/prismic-content-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server