Skip to main content
Glama

get_document_info

Retrieve detailed metadata and properties from a Word document using a standardized interface, enabling efficient document analysis and management.

Instructions

Get information about a Word document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes

Implementation Reference

  • Core handler function that processes the input filename, ensures proper extension for local files, retrieves document properties using a utility function, and returns them as formatted JSON or an error message.
    async def get_document_info(filename: str) -> str:
        """Get information about a Word document from local path or URL.
    
        Args:
            filename: Path or URL to the Word document
        """
        # Only add .docx extension for local paths, not URLs
        if not is_url(filename):
            filename = ensure_docx_extension(filename)
    
        try:
            properties = get_document_properties(filename)
            return json.dumps(properties, indent=2)
        except Exception as e:
            return f"Failed to get document info: {str(e)}"
  • Registers the 'get_document_info' tool with the FastMCP server using the @mcp.tool() decorator. This wrapper function delegates execution to the core handler in document_tools.py and provides the tool description used for schema inference.
    @mcp.tool()
    async def get_document_info(filename: str):
        """Get information about a Word document."""
        return await document_tools.get_document_info(filename)
  • Exposes the get_document_info function by importing it into the tools package __init__.py, making it available for import in the main server registration.
    from word_document_server.tools.document_tools import (
        create_document, get_document_info, get_document_text, 
        get_document_outline, list_available_documents, 
        copy_document, merge_documents
    )
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'gets information', implying a read-only operation, but fails to specify what type of information (e.g., metadata, properties), whether it requires file access permissions, or any side effects. This leaves significant gaps in understanding the tool's behavior.

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 unnecessary words, making it highly concise and front-loaded. It efficiently communicates the core action without redundancy, earning full marks for brevity and clarity in structure.

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 the lack of annotations, 0% schema description coverage, and no output schema, the description is incomplete. It does not explain what information is returned, how errors are handled, or provide enough detail for effective use in a context with many sibling tools, making it inadequate for the tool's complexity.

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

Parameters2/5

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

The input schema has 0% description coverage, with one parameter 'filename' undocumented. The description does not add any meaning beyond the schema, such as explaining the expected format of the filename (e.g., path, extension requirements) or constraints. This fails to compensate for the low schema coverage, leaving the parameter poorly defined.

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 verb ('Get') and resource ('information about a Word document'), making the purpose evident. However, it does not differentiate from sibling tools like 'get_document_outline' or 'get_document_text', which also retrieve document-related information, leaving room for ambiguity in tool selection.

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?

The description provides no guidance on when to use this tool versus alternatives such as 'get_document_outline' or 'get_document_text'. It lacks context about what specific information is retrieved (e.g., metadata vs. content) or any prerequisites, making it unclear in what scenarios this tool is preferred over siblings.

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