Skip to main content
Glama

analyze_document

Destructive

Re-run AI analysis on an already-uploaded document: extracts the text from the stored file, stores it (get_document_text reads it back), replaces its search sections (search_knowledge finds them, source = document_id + sheet/rows) and writes/refreshes the AI-summary section of description. Required: document_id. Only works on documents with an uploaded file (via upload_document), not url-only references. Text extraction supports PDF, Word .docx, Excel .xlsx (per sheet as Markdown table), PowerPoint/OpenDocument and txt/md/csv/json/html; use it to (re)process files uploaded before Office support existed. Returns { ok, description, summary, text_stored, text_chars, indexed_sections, vectorised_sections, index_error? }.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "document_id": "<document_id>"
    },
    "name": "analyze_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
document_idYesID of the document

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / document_id / description
      Added value: +"ID of the document"
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=true), the description discloses exactly what is destroyed and rewritten: search sections are replaced and the AI-summary section of description is refreshed. It also notes partial-failure signaling via the optional index_error field and enumerates the return object, which annotations alone would never convey.

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?

It is front-loaded with the action and side effects before the preconditions and format list, and every sentence carries information. It is dense and parenthetical-heavy ('(get_document_text reads it back)', the long format enumeration), which costs some readability but not correctness.

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?

There is no output schema, and the description compensates fully by spelling out the returned fields (ok, description, summary, text_stored, text_chars, indexed_sections, vectorised_sections, index_error). For a destructive, non-idempotent re-processing tool, the preconditions, supported formats, and failure marker cover everything an agent needs before invoking it.

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?

Schema coverage is 100% and the single parameter is self-explanatory, so the schema does most of the work. The description nonetheless adds real meaning: document_id is only valid for documents that have an actual uploaded file (not URL-only references), which constrains which IDs will succeed. That is genuine semantics beyond 'ID of the document'.

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 opens with a specific verb+resource ('Re-run AI analysis on an already-uploaded document') and then enumerates the concrete side effects: text extraction and storage, replacement of search sections, and refresh of the AI-summary section. It is unambiguously distinguishable from siblings like get_document_text (which it explicitly says reads the stored text back) and search_knowledge (which it says finds the sections).

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?

It states both when to use it ('use it to (re)process files uploaded before Office support existed') and when it will not work ('Only works on documents with an uploaded file (via upload_document), not url-only references'). It also names the sibling tools that handle the read/index sides, so the agent knows what not to call instead.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.