[Bug]: MCP "ask" tool exposes an empty parameters schema ({"type":"object"} with no "properties"), rejected by strict tool-calling clients
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start at the @app.get("/ask") endpoint and the attach_mcp registration path, then inspect the /mcp/schema output for the ask tool. Ensure its object parameters schema includes a properties key while preserving context_type, query, score_ratio, and max_results, and verify that strict MCP clients accept the generated schema.
由索引模型根据 Issue 内容生成。
描述
crawl4ai version
0.9.2
Expected Behavior
Every MCP tool exposed by the mcp server should publish a valid JSON-Schema for its parameters. For an object-type schema that means including a properties key (even if empty). Strict OpenAI-compatible tool-calling clients require parameters.properties to be present, otherwise the fail to load.
Current Behavior
The ask MCP tool publishes a parameters schema of exactly:
{ "type": "object" }
with no properties key. Strict validators reject it. LM Studio or LibreChat, for example, returns a 400 before the request even runs:
400 [{"code":"invalid_type","expected":"object","received":"undefined",
"path":[<n>,"function","parameters","properties"],"message":"Required"}]
Every other MCP tool (md, html, screenshot, pdf, crawl) works, because they are POST endpoints backed by a Pydantic body model and therefore get a fully-populated properties schema. ask is the only tool defined as @app.get("/ask") using FastAPI Query(...) params (context_type, query, score_ratio, max_results). The MCP bridge appears to derive the input schema from the Pydantic request body only, so a query-parameter endpoint yields an empty object schema. Net effect: the ask tool is unusable with any MCP client that strictly validates tool schemas, and there is no config/env flag to disable just that tool (attach_mcp registers all @mcp_tool endpoints unconditionally).
Is this reproducible?
Yes
Inputs Causing the Bug
- Any OpenAI-compatible MCP client that validates tool JSON-Schemas (e.g. LM Studio)
- Tool: ask (function name "ask_mcp_crawl4ai" in clients)
- Server: official Crawl4AI Docker deployment, MCP over /mcp/sse (or HTTP)
Steps to Reproduce
1. Run the Crawl4AI Docker server (0.9.2) with the MCP endpoint enabled.
2. GET /mcp/schema and inspect the "ask" tool — its parameters are {"type":"object"} with no "properties".
3. Connect a strict OpenAI-compatible client (LM Studio, Librechat) to the MCP endpoint, enabling the crawl4ai tools.
4. Send any chat completion that includes the tool list.
5. Observe a 400: parameters.properties "Required" for the ask tool; the request never runs.
Code snippets
Not applicable
OS
Linux (official Crawl4AI Docker image)
Python version
unclecode/crawl4ai:0.9.2 image (Python 3.x)
Browser
N/A
Browser version
N/A
Error logs & Screenshots (if applicable)
No response
- 主要语言
- Python
- 星标
- 84.5k
- 派生
- 8.7k
- 平均合并
- 3 天 20 小时
- 30 天内合并 PR
- 15
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
unclecode/crawl4ai 的其他 Issue
-
🐞 Bug 🩺 Needs Triage
难度 2/5 1-3 小时 新手友好度 84/100
unclecode/crawl4ai#2319 · 2 条评论 ·
维护者通常 1 天内回复
-
[Bug]: Reusing BFSDeepCrawlStrategy leaks the previous crawl's max_pages budget into a fresh run未关闭
难度 2/5 1-3 小时 新手友好度 78/100
unclecode/crawl4ai#2309 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 84/100
unclecode/crawl4ai#2147 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
unclecode/crawl4ai#2123 · 1 条评论 ·
维护者通常 1 天内回复
-
🐞 Bug 🩺 Needs Triage
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
查看 unclecode/crawl4ai 的全部 Issue
相似的 Issue
-
repo-audit
难度 2/5 1-3 小时 新手友好度 75/100
scverse/repo-health#20 ·
维护者通常 1 天内回复
-
/context/prime scope override double-prefixes an entity-ref project and drops its scoped memories未关闭
难度 2/5 1-3 小时 新手友好度 85/100
phasespace-labs/palinode#232 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
collective/icalendar#1858 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
langflow-ai/langflow#15496 ·
维护者通常 1 天内回复