Skip to main content
Glama

get_document_info

Retrieve metadata from Office files: detect document type, file size, and format-specific details such as paragraphs, sheets, or slide count.

Instructions

Return metadata for a single Office file.

Detects the format by extension and dispatches to the format-specific *_get_info tool. The returned dict is a superset of the underlying tool's dict, augmented with type ("word" / "excel" / "pptx") and size_bytes.

Args: path: Path to an existing Office file (abs or relative to folder/default folder). folder: Optional base folder for relative paths.

Returns: A dict with:

* ``type`` — one of ``"word"``, ``"excel"``, ``"pptx"``.
* ``size_bytes`` — file size in bytes.
* Format-specific fields: for ``.docx`` →
  ``paragraphs``, ``sections``, ``tables``, ``images``,
  ``properties``; for ``.xlsx`` → ``sheets`` (list),
  ``sheet_count``, ``sheet_names``; for ``.pptx`` →
  ``slide_count``, ``layouts``, ``dimensions_inches`` (with
  ``width_inches`` / ``height_inches``).

Raises: OfficeMCPError: ERR_FILE_NOT_FOUND if the file is missing (VAL-GEN-010), ERR_UNSUPPORTED_FMT if the extension is not one of .docx / .xlsx / .pptx.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
folderNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations, the description carries the full burden. It discloses detection by extension, dispatching logic, and the returned dict structure including format-specific fields. It does not mention side effects, but for a read-only metadata tool this is sufficient.

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 well-structured with a purpose statement, dispatching note, Args, Returns, and Raises sections. It is fairly concise but could be slightly trimmed; overall efficient and front-loaded.

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

Completeness5/5

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

Given the tool's complexity (2 params, output schema exists, many siblings), the description is thorough: it covers return values for all formats, error types, and explains dispatching. It provides enough context for correct invocation.

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?

Despite 0% schema description coverage, the Args section adds meaning: path is described as an absolute or relative path to an existing Office file, folder as an optional base folder. This compensates for the schema's lack of descriptions.

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 tool returns metadata for a single Office file, specifies it dispatches to format-specific tools, and distinguishes from siblings like list_documents and format-specific get_info tools by mentioning the superset dict with type and size_bytes.

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

Usage Guidelines4/5

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

The description explains when to use (for metadata of an Office file by path) and indirectly suggests when not to use by noting it dispatches to format-specific tools, implying those provide more detail. However, it lacks explicit exclusions or alternatives for other tools.

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/gawirable/office-mcp'

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