fix: Add docstring to MCP tool 'md' endpoint

Fixes #1652

The `get_markdown` function was missing a docstring, which caused the MCP
tool 'md' to have no description when exposed via `_list_tools()`. This
made it difficult for LLMs and developers to understand the tool's purpose.

Added comprehensive docstring describing the tool's functionality and
supported extraction modes.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Yurii Chukhlib
2026-01-17 11:24:20 +01:00
parent c85f56b085
commit 37ff85f4b1

View File

@@ -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://)")