MCP server for retrieving documents from Dify knowledge bases
This server has a single tool (dify_retriever) with critical quality gaps. The tool name lacks a proper action verb prefix, the description is template-injected (Chinese, non-English), parameter descriptions are minimal, and the schema lacks proper documentation of output structure. The tool is visible in dify.go (getDifyTool() and difyHandler), but fundamental definition quality issues prevent any tool from scoring above 40. Average of 1 tool = 28.
检索 %s 知识库
Tool name 'dify_retriever' does not follow verb_noun convention. Should be 'search_dify' or 'retrieve_from_dify' to clearly signal the action to the LLM. Current name is vague about what happens when called.
Tool description '检索 %s 知识库' is in Chinese, non-English, and uses template injection (%s). LLMs operate primarily in English; non-English descriptions reduce discoverability and clarity.
Input parameter 'query' has description '检索内容' (Chinese: 'search content'). Non-English descriptions are inaccessible to English-fluent LLMs. Parameter descriptions must be in English and explain the expected format/constraints.
No output schema documented. The handler returns json.Marshal(docs) without declaring what 'docs' contains (fields, types, structure). LLMs cannot plan downstream operations without knowing the response structure. Critical for pattern:tool.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 32 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 25 | - | v1 |
Credentials (DIFY_DATASET_API_KEY, DIFY_ENDPOINT, DIFY_DATASET_ID) are loaded from environment variables inside the handler, not injected at registration time. While this avoids exposing them as parameters (good), there is no documentation that these must be set, or what happens if they're missing. Error message would be silent failure or cryptic dify.NewRetriever error.
Error handling is minimal. If query is not a string, returns 'query must be a string'. If dify.NewRetriever fails, returns the raw error. If Retrieve fails, returns raw error. No recovery guidance, no actionable next steps for the LLM. Violates pattern:recovery-guide.
No pagination support. If the Dify API returns many documents, they are all marshalled into JSON and returned as a single response. Large result sets blow the context window and degrade LLM reasoning. No limit parameter, no offset/page parameters, no total count returned.