Skip to main content
Glama

Diagnose Document

diagnose_document
Read-only

Run a read-only structural health report on Word .docx files to identify problems like broken cross-references, dangling parts, undefined styles, and orphan content before they cause data loss.

Instructions

Produce a one-call structural health report, read-only: content-type coverage, dangling relationships and orphan parts, field balance per story part, footnote/endnote integrity, references to undefined styles and numbering, content-control and bookmark sanity, duplicate revision ids, missing image targets, broken cross-references, and a per-part size profile. Never fails on a weird-but-openable document; every check degrades to a reported problem, and healthy=false only for problems that render broken or lose content in Word. The deep companion to validate(checks=['core']). No live mode BY DESIGN: this reads the saved package's XML, stale while Word holds unsaved changes. Close the document first, or use com_validate_opens_clean (com-live pack) / live get_document_info. The full validate check battery lives in the academic pack.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.6.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the description adds context beyond that by detailing the scope of the health report and the degradation behavior ('Never fails on a weird-but-openable document; every check degrades to a reported problem'). It also reveals the stale-data limitation and the design choice to avoid live mode, which is valuable context not conveyed by annotations.

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 dense but well-structured: front-loaded with the core purpose, then behavioral guarantees, usage conditions, and alternatives. While lengthy, every sentence adds value. It could be slightly trimmed, but it's not verbose.

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 (numerous checks) and that annotations provide read-only hint, the description is complete. It covers what the tool does, how it behaves on problematic documents, when to use alternatives, and the critical limitation (stale data). The output schema is present, so return format is already defined. Nothing critical is missing for an agent to invoke it correctly.

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?

Schema coverage is 0%, meaning the description must compensate for the lack of parameter documentation. However, the only parameter is file_path, which is self-explanatory from the schema. The description doesn't explicitly state that file_path is required or what format it should be, but the name alone is sufficient. The description's enumeration of checks indirectly clarifies the expected behavior, but no additional syntax or constraints are given.

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's purpose: produce a structural health report for a document. It enumerates specific checks (content-type coverage, dangling relationships, orphan parts, etc.), making it distinct from siblings like get_document_info or validate. The phrase 'one-call structural health report' is a specific verb+resource, and the read-only nature is highlighted.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool: as a companion to validate(checks=['core']), and it specifies when NOT to use it (when the document has unsaved changes in Word). It also names alternatives: com_validate_opens_clean and get_document_info, with clear conditions. This is exemplary usage guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.