Skip to main content
Glama

get_document_properties

Extract document properties and metadata from Microsoft Word files to analyze file details and content information.

Instructions

Get document properties and metadata.

Args: filepath: Path to the document

Returns: Dictionary with document properties

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filepathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The implementation of the get_document_properties tool, which retrieves document metadata using python-docx and registers the function with the FastMCP application.
    @app.tool()
    def get_document_properties(filepath: str) -> dict[str, Any]:
        """
        Get document properties and metadata.
    
        Args:
            filepath: Path to the document
    
        Returns:
            Dictionary with document properties
        """
        logger.info(
            "Getting document properties",
            extra={"tool": "get_document_properties", "filepath": filepath},
        )
    
        try:
            doc = safe_open_document(filepath)
            props = doc.core_properties
    
            return {
                "status": "success",
                "filepath": filepath,
                "properties": {
                    "title": props.title or "",
                    "subject": props.subject or "",
                    "author": props.author or "",
                    "keywords": props.keywords or "",
                    "comments": props.comments or "",
                    "category": props.category or "",
                    "created": str(props.created) if props.created else None,
                    "modified": str(props.modified) if props.modified else None,
                },
            }
        except DocxMcpError as e:
            logger.warning(
                e.message,
                extra={"tool": "get_document_properties", "error_code": e.error_code},
            )
            return {"status": "error", "error": e.message, "error_code": e.error_code}
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 retrieves properties and metadata, implying a read-only operation, but doesn't cover critical aspects like permissions needed, error handling, rate limits, or what specific properties are returned. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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 appropriately sized and front-loaded, with the core purpose stated first. The 'Args' and 'Returns' sections are structured but slightly redundant, as the output schema exists. Overall, it's efficient with little wasted text, though it could be more streamlined by omitting the structured sections given the schema coverage.

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

Completeness3/5

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

Given the tool's low complexity (one parameter) and the presence of an output schema (which handles return values), the description is minimally adequate. However, with no annotations and incomplete behavioral details, it doesn't fully compensate for the lack of structured metadata, leaving gaps in usage context and error handling.

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 minimal value beyond the input schema. It mentions 'filepath' as the parameter but doesn't clarify format expectations (e.g., absolute vs. relative paths, file extensions) or provide examples. With 0% schema description coverage and only one parameter, the baseline is 3, as the schema alone defines the parameter adequately but without extra semantic context.

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 tool's purpose with a specific verb ('Get') and resource ('document properties and metadata'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'read_docx' or 'list_styles', which might also retrieve document information, leaving some ambiguity about its unique role.

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. With siblings like 'read_docx' (which might retrieve content) and 'list_styles' (which might list formatting), the description lacks context on prerequisites, exclusions, or comparative use cases, offering minimal assistance in tool selection.

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/Andrew82106/LLM_Docx_Agent_MCP'

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