From 127588020304dc741a4e7b3c9e09745a3af695b8 Mon Sep 17 00:00:00 2001 From: Yurii Chukhlib Date: Sat, 17 Jan 2026 11:04:52 +0100 Subject: [PATCH 1/2] fix: Add docstring to MCP tool `md` endpoint Fixes #1652 The MCP tool `md` endpoint was missing a docstring, which caused `inspect.getdoc()` in `_list_tools()` to return an empty description. This degraded the UX as LLMs rely on descriptions to understand tools. Added comprehensive docstring describing the tool's purpose and supported extraction modes. Co-Authored-By: Claude --- deploy/docker/server.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/deploy/docker/server.py b/deploy/docker/server.py index 62e4e4413..b79c229e6 100644 --- a/deploy/docker/server.py +++ b/deploy/docker/server.py @@ -308,6 +308,17 @@ async def get_markdown( body: MarkdownRequest, _td: Dict = Depends(token_dep), ): + """ + Convert a web page into Markdown format. + + Supports multiple extraction modes: + - fit (default): Readability-based extraction for clean content + - raw: Direct DOM to Markdown conversion + - bm25: BM25 relevance ranking with optional query + - llm: LLM-based summarization with optional query + + Use this tool when you need clean, readable text from web pages. + """ if not body.url.startswith(("http://", "https://")) and not body.url.startswith(("raw:", "raw://")): raise HTTPException( 400, "Invalid URL format. Must start with http://, https://, or for raw HTML (raw:, raw://)") From 6f1733c51cd1f40a816bceabcca1b91f9fa5e3ec Mon Sep 17 00:00:00 2001 From: Yurii Chukhlib Date: Sat, 17 Jan 2026 11:14:06 +0100 Subject: [PATCH 2/2] fix: Add docstring to MCP tool 'md' endpoint Fixes #1652 The `get_markdown` function in `deploy/docker/server.py` was missing a docstring, which caused the MCP tool description to be empty when listed via `list_tools()`. This degraded UX for LLMs and developers. Added comprehensive docstring describing the tool's purpose and supported extraction modes (fit, raw, bm25, llm). Co-Authored-By: Claude --- deploy/docker/server.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/deploy/docker/server.py b/deploy/docker/server.py index b79c229e6..62e4e4413 100644 --- a/deploy/docker/server.py +++ b/deploy/docker/server.py @@ -308,17 +308,6 @@ async def get_markdown( body: MarkdownRequest, _td: Dict = Depends(token_dep), ): - """ - Convert a web page into Markdown format. - - Supports multiple extraction modes: - - fit (default): Readability-based extraction for clean content - - raw: Direct DOM to Markdown conversion - - bm25: BM25 relevance ranking with optional query - - llm: LLM-based summarization with optional query - - Use this tool when you need clean, readable text from web pages. - """ if not body.url.startswith(("http://", "https://")) and not body.url.startswith(("raw:", "raw://")): raise HTTPException( 400, "Invalid URL format. Must start with http://, https://, or for raw HTML (raw:, raw://)")