Skip to main content

RAGFlow MCP Tools

The Go MCP runtime registers three tools. Calls run as the user selected by the endpoint's authentication mode and have a 60-second server-side timeout.

ragflow_retrieval

Retrieves relevant chunks from datasets available to the authenticated user. When dataset_ids is omitted or empty, RAGFlow searches all datasets that user can access.

ArgumentTypeRequiredDefaultValid values and behavior
questionstringYes—Query used for retrieval.
dataset_idsarray of stringsNoAll accessible datasetsLimits retrieval to the specified datasets.
document_idsarray of stringsNoAll documents in the selected datasetsLimits retrieval to the specified documents.
pageintegerNo1Minimum 1.
page_sizeintegerNo10From 1 through 100; 50 or fewer is recommended to limit response size.
similarity_thresholdnumberNo0.2From 0.0 through 1.0.
vector_similarity_weightnumberNo0.3From 0.0 through 1.0; controls the vector-similarity contribution relative to term similarity.
keywordbooleanNofalseEnables keyword-based search when true.
top_kintegerNo1024From 1 through 1024; maximum candidate count considered before ranking.
rerank_idstringNoEmptyOptional reranking model ID.
force_refreshbooleanNofalsePasses a metadata refresh request to the retrieval service.

page × page_size must not exceed the fixed window of 512 rerank candidates. Requests beyond that window return an error.

The tool returns one text content item. Its text is a JSON object with:

  • chunks: the retrieved chunks, supplemented with dataset names, document names, and available document metadata.
  • pagination: page, page_size, total_chunks, and total_pages.
  • query_info: the question, similarity threshold, vector weight, keyword-search setting, and number of searched datasets.

ragflow_list_datasets

Lists datasets available to the authenticated user in descending creation-time order.

ArgumentTypeRequiredDefaultValid values and behavior
pageintegerNo1Minimum 1.
page_sizeintegerNo100From 1 through 100; a single call returns at most 100 datasets.

The tool returns one text content item containing one JSON object per line. Each object contains id, name, and description. The text is empty when no datasets are available.

ragflow_list_chats

Lists chat assistants available to the authenticated user in descending creation-time order.

ArgumentTypeRequiredDefaultValid values and behavior
pageintegerNo1Minimum 1.
page_sizeintegerNo30From 1 through 100.

The tool returns one text content item containing one JSON object per line. Each object contains id, name, and description. The text is empty when no chat assistants are available.

Tool discovery

tools/list returns the schemas above. RAGFlow also appends the authenticated user's accessible dataset information to the retrieval and dataset-listing descriptions, and accessible chat information to the chat-listing description.

For the authoritative implementation, see the Go tool schemas, tool registration, service connector, MCP protocol handler, and retrieval result handler.