Skip to main content
Glama

move_document

Relocate a document to a new collection or parent while preserving its nested hierarchy. Use to reorganize content structure, change collections, or update document nesting within the MCP Outline Server.

Instructions

    Relocates a document to a different collection or parent document.
    
    IMPORTANT: When moving a document that has child documents (nested 
    documents), all child documents will move along with it, maintaining 
    their hierarchical structure. You must specify either collection_id or 
    parent_document_id (or both).
    
    Use this tool when you need to:
    - Reorganize your document hierarchy
    - Move a document to a more relevant collection
    - Change a document's parent document
    - Restructure content organization
    
    Args:
        document_id: The document ID to move
        collection_id: Target collection ID (if moving between collections)
        parent_document_id: Optional parent document ID (for nesting)
        
    Returns:
        Result message confirming the move operation
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collection_idNo
document_idYes
parent_document_idNo

Implementation Reference

  • The core handler function for the 'move_document' tool. It validates inputs, constructs the API request to Outline's documents.move endpoint, executes the move operation, and returns success/error messages. The function signature provides the input schema, and annotations indicate it's destructive and non-idempotent.
    @mcp.tool(
        annotations=ToolAnnotations(
            readOnlyHint=False,
            destructiveHint=True,
            idempotentHint=False,
        )
    )
    async def move_document(
        document_id: str,
        collection_id: Optional[str] = None,
        parent_document_id: Optional[str] = None,
    ) -> str:
        """
        Relocates a document to a different collection or parent document.
    
        IMPORTANT: When moving a document that has child documents (nested
        documents), all child documents will move along with it, maintaining
        their hierarchical structure. You must specify either collection_id or
        parent_document_id (or both).
    
        Use this tool when you need to:
        - Reorganize your document hierarchy
        - Move a document to a more relevant collection
        - Change a document's parent document
        - Restructure content organization
    
        Args:
            document_id: The document ID to move
            collection_id: Target collection ID (if moving between collections)
            parent_document_id: Optional parent document ID (for nesting)
    
        Returns:
            Result message confirming the move operation
        """
        try:
            client = await get_outline_client()
    
            # Require at least one destination parameter
            if collection_id is None and parent_document_id is None:
                return (
                    "Error: You must specify either a collection_id or "
                    "parent_document_id."
                )
    
            data = {"id": document_id}
    
            if collection_id:
                data["collectionId"] = collection_id
    
            if parent_document_id:
                data["parentDocumentId"] = parent_document_id
    
            response = await client.post("documents.move", data)
    
            # Check for successful response
            if response.get("data"):
                return "Document moved successfully."
            else:
                return "Failed to move document."
        except OutlineClientError as e:
            return f"Error moving document: {str(e)}"
        except Exception as e:
            return f"Unexpected error: {str(e)}"
  • The registration function for document organization tools, which defines and registers the move_document tool via the @mcp.tool decorator.
    def register_tools(mcp) -> None:
        """
        Register document organization tools with the MCP server.
    
        Args:
            mcp: The FastMCP server instance
        """
  • Registers document organization tools (including move_document) by calling document_organization.register_tools(mcp), conditionally if not in read-only mode.
    document_organization.register_tools(mcp)
  • Entry point for registering all document features, including organization tools with move_document, via documents.register(mcp).
    documents.register(mcp)
  • Imports helper functions from common.py used by the move_document handler: get_outline_client() to obtain the Outline API client and OutlineClientError for error handling.
    from mcp_outline.features.documents.common import (
        OutlineClientError,
        get_outline_client,
    )
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 describes key behaviors: the hierarchical move of child documents, the requirement to specify at least one target parameter, and the confirmation message return. However, it lacks details on permissions, error conditions, or rate limits, which are important for a mutation tool.

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 clear sections (overview, important note, usage guidelines, args, returns). Each sentence adds value: the first states the purpose, the second explains child document behavior, the third specifies parameter requirements, and the bullet points provide usage context. No wasted words.

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 mutation tool with 3 parameters, 0% schema coverage, and no output schema, the description does a good job covering purpose, behavior, and parameters. It explains the hierarchical move effect and return message. However, it lacks details on error cases (e.g., invalid IDs, permission issues) and doesn't fully describe the return value 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?

Schema description coverage is 0%, so the description must compensate. It adds meaningful context for all three parameters: document_id is the item to move, collection_id is for moving between collections, and parent_document_id is for nesting. It clarifies the 'either/or' logic and optionality, though it doesn't specify format constraints (e.g., ID structure).

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 ('relocates') and resource ('document'), distinguishing it from siblings like 'update_document' or 'delete_document'. It specifies the destination ('different collection or parent document'), making the purpose unambiguous and distinct.

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 (e.g., 'Reorganize your document hierarchy', 'Move a document to a more relevant collection'), providing clear guidance on when to use this tool. It also specifies parameter requirements ('You must specify either collection_id or parent_document_id'), which helps differentiate from alternatives like 'update_document'.

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