MCP server that integrates with Dify platform to provide access to knowledge bases, documents, and semantic search capabilities
The server implements 8 well-scoped read-only tools for Dify knowledge base access. Tool naming follows verb_noun conventions (list_, search_, show_, get_) with clear action intent. All tools have descriptions exceeding 20 characters and input schemas with type definitions visible in src/index.ts. However, critical gaps emerge: (1) output schemas are NOT documented, responses are returned as JSON strings with no documented field structure, breaking the ability for LLMs to understand what data is available downstream; (2) parameter descriptions are generally good but lack actionable format constraints (e.g., no regex patterns, min/max for numeric fields, or enumeration boundaries for top_k, limit, page); (3) no error handling guidance is visible, tools return raw API responses with no recovery instructions; (4) no evidence of input validation or sanitization despite accepting user-provided queries; (5) pagination fields (page, limit) lack bounds documentation; (6) response fields do not include chaining IDs needed for multi-step workflows (e.g., after searching, can you call get_segment_detail with the returned segment_id?). Average per-tool definition score: 62. The architecture is sound (clean separation of tools, proper SDK integration), but LLM usability and error resilience are underdeveloped.
获取指定分段的所有子分段信息,子分段是对父分段的进一步细分,提供更精细的内容粒度,支持关键词搜索和分页
获取指定文档的所有分段信息,分段是文档的基本检索单元,支持关键词过滤、状态筛选和分页查询
获取指定分段的完整详细信息,包括分段内容、签名内容、答案、关键词、子分段列表、处理状态等全部元数据
获取指定知识库中的所有文档列表,支持分页查询,返回文档基本信息包括名称、字符数、访问次数、位置等
获取 Dify 平台中所有可用的知识库列表,支持分页查询,返回知识库基本信息包括名称、描述、文档数量等
在指定知识库中进行智能搜索,支持多种搜索算法(语义搜索、关键词搜索、全文搜索、混合搜索),可设置相关性阈值和结果重排序
Output schemas not documented. All tools return JSON.stringify(result) with no field documentation, making it impossible for LLMs to understand response structure or chain results to downstream tools.
Pagination parameters (limit, page) lack bounds. No min/max specified; LLMs could pass absurd values (limit=999999). Rubric baseline: numeric params should specify min-max ranges.
No error handling guidance. Tools execute via DifyKnowledgeTools class but no try-catch, timeout, or recovery messaging visible in error paths. LLMs receive raw errors with no actionable next steps.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | C | 63 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 37 | - | v1 |
获取知识库中指定文档的详细信息,包括文档名称、字符数、访问次数、位置序号、创建和更新时间等
获取指定知识库的详细信息,包括知识库名称、描述、文档总数、创建时间等元数据信息
search_knowledge_base accepts user query but no input sanitization visible. Prompt injection via 'query' parameter could be passed directly to Dify API without validation or escaping.
Response chaining broken. E.g., dify_get_document_segments returns segments but response format unknown; cannot determine if segment_id, document_id, dataset_id are included, blocking downstream dify_get_child_segments or dify_get_segment_detail calls.
Enum constraint for search_method in dify_search_knowledge_base is properly defined (z.enum), but other parameters with constrained values (e.g., status in dify_get_document_segments) are free-form strings with no enum.
No documentation of default values. E.g., top_k defaults to 3, search_method defaults to semantic_search, reranking_enable defaults to true, these should be explicit in parameter descriptions to help LLMs predict behavior.