Skip to main content
Glama

add_page_break

Insert a page break into a Microsoft Word document to organize content and improve readability, using the Office Word MCP Server for document formatting.

Instructions

Add a page break to the document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes

Implementation Reference

  • Core handler function that loads the specified Word document, appends a page break using python-docx, saves the document, and returns a success or error message.
    async def add_page_break(filename: str) -> str:
        """Add a page break to the document.
        
        Args:
            filename: Path to the Word document
        """
        filename = ensure_docx_extension(filename)
        
        if not os.path.exists(filename):
            return f"Document {filename} does not exist"
        
        # Check if file is writeable
        is_writeable, error_message = check_file_writeable(filename)
        if not is_writeable:
            return f"Cannot modify document: {error_message}. Consider creating a copy first."
        
        try:
            doc = Document(filename)
            doc.add_page_break()
            doc.save(filename)
            return f"Page break added to {filename}."
        except Exception as e:
            return f"Failed to add page break: {str(e)}"
  • MCP tool registration in the main server file using the FastMCP @mcp.tool() decorator. This defines the tool schema via the function signature and docstring, and delegates execution to the handler in content_tools.py.
    @mcp.tool()
    async def add_page_break(filename: str):
        """Add a page break to the document."""
        return await content_tools.add_page_break(filename)
Behavior2/5

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

With no annotations, the description carries full burden but only states the action without behavioral details. It does not disclose if this requires write permissions, affects document layout irreversibly, or has side effects like pagination changes. More context on mutation behavior is needed for a tool that modifies documents.

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 a single, direct sentence with no wasted words, making it highly concise and front-loaded. It efficiently communicates the core action without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and low schema coverage, the description is incomplete. It lacks details on how the page break is added (e.g., at cursor position, end of document), what the tool returns, or error conditions, which are crucial for a mutation tool in a document editing context.

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

Parameters3/5

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

The description adds no parameter information beyond the schema, which has 0% coverage for the single parameter 'filename'. However, since there is only one parameter, the baseline is higher, but the description fails to explain what 'filename' represents (e.g., path, identifier) or format expectations, leaving a gap in understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add') and target ('page break to the document'), making the purpose understandable. However, it does not differentiate from sibling tools like 'add_paragraph' or 'add_heading' in terms of document structure, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'add_paragraph' for text insertion or 'add_heading' for section breaks. The description lacks context about prerequisites, such as needing an existing document, or exclusions, leaving the agent with minimal usage direction.

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/franlealp1/mcp-word'

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