read_converted_markdown
Access converted markdown content from Office documents for processing or analysis after conversion.
Instructions
Read the content of a previously converted markdown file.
Use this after convert_document to get the actual markdown content. This is useful when you want to process or analyze the converted document.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| markdown_path | Yes | Path to the markdown file (returned by convert_document) |
Implementation Reference
- src/officereader_mcp/server.py:222-243 (handler)Handler for 'read_converted_markdown' tool: validates input path, checks file existence, reads the markdown file content, and returns it as TextContent with metadata.elif name == "read_converted_markdown": markdown_path = arguments.get("markdown_path") if not markdown_path: return [TextContent( type="text", text=f"{cache_notice}\n\n" + json.dumps({"error": "markdown_path is required"}, ensure_ascii=False) )] path = Path(markdown_path) if not path.exists(): return [TextContent( type="text", text=f"{cache_notice}\n\n" + json.dumps({"error": f"File not found: {markdown_path}"}, ensure_ascii=False) )] with open(path, "r", encoding="utf-8") as f: content = f.read() return [TextContent( type="text", text=f"{cache_notice}\n[Reading] {markdown_path}\n[Length] {len(content)} characters\n\n---\n\n{content}" )]
- Input schema definition for the 'read_converted_markdown' tool, specifying the required 'markdown_path' parameter.inputSchema={ "type": "object", "properties": { "markdown_path": { "type": "string", "description": "Path to the markdown file (returned by convert_document)", }, }, "required": ["markdown_path"], },
- src/officereader_mcp/server.py:100-117 (registration)Registration of the 'read_converted_markdown' tool in the list_tools() function.Tool( name="read_converted_markdown", description="""Read the content of a previously converted markdown file. Use this after convert_document to get the actual markdown content. This is useful when you want to process or analyze the converted document.""", inputSchema={ "type": "object", "properties": { "markdown_path": { "type": "string", "description": "Path to the markdown file (returned by convert_document)", }, }, "required": ["markdown_path"], }, ), Tool(