Skip to main content
Glama

prismic_get_document

Retrieve a specific Prismic document by ID or type+UID, optionally specifying a preview or release version for content management workflows.

Instructions

Get one document by id or by type+uid with optional explicit ref.

Use ref to read a specific preview/release version pointer. Depending on repository API visibility settings, non-master refs may require PRISMIC_CONTENT_API_TOKEN. The document payload has no explicit status field (for example published/draft/in-release). To determine publish state on master, use this sequence:

  1. Call prismic_get_refs and capture the master ref.

  2. Call prismic_get_document(..., ref=<master_ref>).

  3. Call prismic_get_document(..., ref=<release_ref>) as needed.

  4. Interpret results:

    • exists on master: published on master

    • missing on master but exists on release ref: not published on master (release-only content) Prefer this over prismic_get_documents when you already have an exact id or type+uid target.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNo
typeNo
uidNo
langNo
refNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler logic for retrieving a Prismic document, either by ID or by type/UID.
    async def handle_prismic_get_document(
        *,
        id: str | None = None,
        type: str | None = None,
        uid: str | None = None,
        lang: str | None = None,
        ref: str | None = None,
        service_factory: ServiceFactory = _build_service,
    ) -> dict[str, Any]:
        """Fetch a single document by id or by (type, uid, lang) with optional ref."""
    
        async with service_factory() as service:
            if id:
                document = await service.get_document_by_id(document_id=id, lang=lang, ref=ref)
            elif type and uid:
                document = await service.get_document_by_uid(
                    document_type=type,
                    uid=uid,
                    lang=lang,
                    ref=ref,
                )
            else:
                raise ValueError("Provide id OR (type and uid)")
    
        return {
            "document": document.model_dump(mode="python") if document else None,
        }
  • The MCP tool registration for `prismic_get_document`, which routes the request to the `handle_prismic_get_document` function.
    @server.tool(name="prismic_get_document")
    async def prismic_get_document(
        id: str | None = None,
        type: str | None = None,
        uid: str | None = None,
        lang: str | None = None,
        ref: str | None = None,
    ) -> dict[str, Any]:
        """Get one document by id or by type+uid with optional explicit ref.
    
        Use `ref` to read a specific preview/release version pointer. Depending
        on repository API visibility settings, non-master refs may require
        `PRISMIC_CONTENT_API_TOKEN`.
        The document payload has no explicit `status` field (for example
        published/draft/in-release). To determine publish state on master, use
        this sequence:
        1) Call `prismic_get_refs` and capture the `master` ref.
        2) Call `prismic_get_document(..., ref=<master_ref>)`.
        3) Call `prismic_get_document(..., ref=<release_ref>)` as needed.
        4) Interpret results:
           - exists on master: published on master
           - missing on master but exists on release ref: not published on master
             (release-only content)
        Prefer this over `prismic_get_documents` when you already have an exact
        id or type+uid target.
        """
    
        return await handle_prismic_get_document(
            id=id,
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. It effectively explains key behaviors: the need for PRISMIC_CONTENT_API_TOKEN for non-master refs, the absence of a status field in the payload, and the multi-step process to determine publish state. However, it doesn't mention error handling, rate limits, or authentication requirements beyond the token note.

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?

The description is well-structured and front-loaded with the core purpose, followed by detailed usage notes. While comprehensive, some sentences could be tightened (e.g., the multi-step sequence is verbose but necessary). Overall, it earns its length with valuable information.

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?

Given the complexity (5 parameters, 0% schema coverage, no annotations, but with output schema), the description is highly complete. It covers purpose, usage guidelines, parameter semantics, and behavioral nuances like authentication and publish state determination. The output schema handles return values, so no need to explain them here.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate for all parameters. It explains the purpose of id, type, uid, and ref parameters, including that ref is for 'specific preview/release version pointer.' It also implies lang is for language, though less explicitly. This adds significant meaning beyond the bare schema.

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 tool's purpose: 'Get one document by id or by type+uid with optional explicit ref.' It specifies the exact action (get), resource (document), and two identification methods, distinguishing it from sibling tools like prismic_get_documents (which retrieves multiple documents).

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?

The description provides explicit guidance on when to use this tool: 'Prefer this over prismic_get_documents when you already have an exact id or type+uid target.' It also explains when to use the ref parameter for preview/release versions and outlines a multi-step sequence for determining publish state, offering clear alternatives and context.

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