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 )

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