Skip to main content
Glama

read_document

Retrieve and display the full content of a specific document using the document ID. Use this tool to review, quote, reference, or analyze detailed document information within the MCP Outline Server.

Instructions

    Retrieves and displays the full content of a document.
    
    Use this tool when you need to:
    - Access the complete content of a specific document
    - Review document information in detail
    - Quote or reference document content
    - Analyze document contents
    
    Args:
        document_id: The document ID to retrieve
        
    Returns:
        Formatted string containing the document title and content
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_idYes

Implementation Reference

  • The handler function for the read_document tool, registered via @mcp.tool decorator. Fetches document content from Outline API and formats it for display.
    @mcp.tool(
        annotations=ToolAnnotations(readOnlyHint=True, idempotentHint=True)
    )
    async def read_document(document_id: str) -> str:
        """
        Retrieves and displays the full content of a document.
    
        Use this tool when you need to:
        - Access the complete content of a specific document
        - Review document information in detail
        - Quote or reference document content
        - Analyze document contents
    
        Args:
            document_id: The document ID to retrieve
    
        Returns:
            Formatted string containing the document title and content
        """
        try:
            client = await get_outline_client()
            document = await client.get_document(document_id)
            return _format_document_content(document)
        except OutlineClientError as e:
            return f"Error reading document: {str(e)}"
        except Exception as e:
            return f"Unexpected error: {str(e)}"
  • Helper function to format the raw document dictionary into a markdown string with title and content.
    def _format_document_content(document: Dict[str, Any]) -> str:
        """Format document content into readable text."""
        title = document.get("title", "Untitled Document")
        text = document.get("text", "")
    
        return f"""# {title}
    
    {text}
    """
  • Registers the document_reading module's tools, including read_document, as part of document features.
    document_search.register_tools(mcp)
    document_reading.register_tools(mcp)
    document_collaboration.register_tools(mcp)
    collection_tools.register_tools(mcp)
  • Top-level registration call to documents.register which includes read_document tool.
    # Register document management features
    documents.register(mcp)
Behavior3/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 states the tool 'retrieves and displays' content, implying a read-only operation, but doesn't mention permissions, rate limits, or error handling. It adds some context about the return format, but lacks details on pagination or data freshness.

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 well-structured with a clear purpose statement, bulleted usage guidelines, and separate sections for args and returns. Every sentence adds value without redundancy, making it efficient and easy to parse.

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 simple read operation with 1 parameter and no output schema, the description is mostly complete. It covers purpose, usage, parameters, and return format. However, it lacks details on error cases or behavioral constraints, which would be helpful given the absence of annotations.

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?

The schema has 0% description coverage for the single parameter (document_id), but the description compensates by explaining it as 'The document ID to retrieve'. This adds meaning beyond the schema's basic type information, though it doesn't specify format or sourcing details.

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 with specific verbs ('retrieves and displays') and resource ('full content of a document'). It distinguishes from siblings like search_documents (which finds documents) or get_document_backlinks (which shows relationships), making it evident this is for accessing complete document content.

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 explicitly lists four use cases (access complete content, review in detail, quote/reference, analyze contents) that guide when to use this tool. It implies alternatives like search_documents for finding documents or get_document_backlinks for relationships, though it doesn't explicitly name them, the context is clear enough for a top score.

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

Related 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/Vortiago/mcp-outline'

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