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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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(
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure and does so effectively. It explains security constraints (PRISMIC_UPLOAD_ROOT requirement, path traversal blocking), authentication needs (specific environment variables), and technical implementation details (multipart/form-data, POST /assets). It doesn't mention rate limits or error handling, but covers essential operational context.

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?

The description is efficiently structured with zero wasted sentences. It front-loads the core purpose, then provides implementation details, prerequisites, and security constraints in a logical flow. Each sentence adds essential information without redundancy.

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?

Given the complexity of a media upload operation with security constraints, no annotations, and an output schema present, the description is quite complete. It covers purpose, implementation, prerequisites, and security. The output schema likely handles return values, so the description appropriately focuses on operational context rather than response format.

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?

With 0% schema description coverage, the description must compensate and does so well for most parameters. It explains that 'file_path' is uploaded, and that 'notes', 'credits', and 'alt' are optional metadata mapping to Asset API fields. However, it doesn't provide format expectations or constraints for these string parameters beyond their purpose.

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 description clearly states the specific action ('Upload media via Prismic Asset API') and resource ('file_path'), distinguishing it from sibling tools that primarily retrieve or manage documents, custom types, and slices rather than uploading media assets. It provides concrete technical details about the API endpoint and method.

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 provides clear context for when to use this tool (uploading media assets) and mentions prerequisites (environment variables like PRISMIC_REPOSITORY and PRISMIC_WRITE_API_TOKEN). However, it doesn't explicitly contrast with alternatives or state when not to use it compared to sibling tools like prismic_get_media or document management tools.

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

Install Server

Other Tools

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