An MCP server for managing document operations including reading, editing, and summarizing documents with integrated Claude AI chat interface
DocumentMCP exhibits significant gaps across naming, descriptions, and parameter clarity. While the three tools are explicitly defined with JSON schemas, the descriptions are minimal and several critical parameters lack proper documentation. Tool names follow verb_noun convention but descriptions fail to state what the tools modify, when to use them, or how they fit together. No output schemas are documented. Error handling is basic. The server implements tools, resources, and prompts but lacks the polish and completeness expected of production-grade agent tools.
edit a document by replacing a string in the documents content with a new string
returns a list of all document ids
Reads the contents of a document and returns it as a string
Tool descriptions are too minimal and lack action clarity. 'Reads the contents of a document and returns it as a string' (48 chars) and 'edit a document by replacing a string...' (64 chars) fail to explain WHY or WHEN to call each tool, and do not state that edit_document modifies state.
Output schemas are not documented. Tools return str, dict, or list but LLMs cannot plan downstream calls without knowing the exact structure. A read_doc_contents call should document that it returns a string; edit_document should document what it returns (current code shows no return statement, implying None). get_all_ids should document that it returns a sorted list of strings.
edit_document has no return statement, implying it returns None. This breaks tool composition, callers cannot verify success or inspect the updated document. Best practice: return the modified document content or a success confirmation object so agents can chain calls without a follow-up read_doc_contents.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 44 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 48 | - | v1 |
No enum constraints or format validation on 'old_str' and 'new_str' parameters in edit_document. Description warns 'Must match exactly, including whitespace' but LLMs cannot reliably handle invisible whitespace in free-form text. Consider accepting a 'line_number' or 'section' parameter alongside substring matching, or provide a view_document_diff tool to preview changes before applying.
Error messages are raised as ValueError but never caught or transformed into agent-friendly guidance. 'Document with ID '{doc_id}' not found.' tells the agent the call failed but not how to recover. Per pattern:recovery-guide, errors should suggest the next step: 'Document not found. Call get_all_ids() to see available documents.'
Tool descriptions do not state that edit_document modifies state. Per pattern:command-tool, destructive tools must declare this so agents know the call is irreversible and not safe to retry blindly. No @mcp.tool annotation uses destructiveHint or idempotentHint.
Prompts (format, summarize_doc) reference tools (edit_document) but lack clarity on the prompt flow. The format prompt is incomplete, it cuts off mid-sentence with 'After the document has been reformatted...' and does not define success criteria or expected output. Prompts should be self-contained and guide the LLM to a clear terminal state.