Skip to main content
Glama
ragflow-kb-mcp
by feci

ragflow_upload_document

Adds a document to a RAGFlow dataset from text, base64 bytes, a URL, or an allowed local file, with optional parsing after upload.

Instructions

Add a document to a dataset from text, base64 bytes, a URL or an allowed local file.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "dataset_id": "<dataset_id>"
    },
    "name": "ragflow_upload_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNohttp(s) URL of a PDF or a web page; RAGFlow downloads it itself. Other file types from a URL are rejected by RAGFlow: send them as text or content_base64.
textNoUTF-8 text content, e.g. Markdown
parseNoStart parsing after the upload
filenameNoDocument name with an extension that sets the parser (.md, .txt, .pdf, .docx, ...). Required for text and content_base64; defaults to the file name for file_path and url. For url uploads RAGFlow keeps only letters, digits, - and _ and adds .pdf or .html itself.
file_pathNoPath on the MCP server host, inside an allowed upload root
dataset_idYesDataset (knowledge base) ID
meta_fieldsNoDocument metadata, used for filtering in retrieval
wait_secondsNoSeconds to wait for parsing to finish; 0 returns immediately
content_base64NoFile bytes as base64 (small files only)
replace_existingNoIf a document with the same name exists, replace it. Without this flag a duplicate name is an error.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=false, openWorldHint=true and destructiveHint=false, and 'Add' is consistent with a non-read-only write. The description adds only the 'allowed local file' restriction; it says nothing about parse/wait behavior or the replace-vs-duplicate-name semantics, though those live in the schema. With annotation coverage this is adequate but thin.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler that leads with the action and then the accepted inputs. It is efficient, though at 10 parameters it borders on under-specified rather than merely concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema and annotations are present, so return-value and safety concerns are covered elsewhere. However, with ten parameters and four alternative source modes, the description never states that a source must be supplied (only dataset_id is required by the schema) or how the modes interact with parse and replace_existing. Some essential calling context is missing for a tool of this complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all ten parameters are already documented in the schema, including url format limits, filename extension rules and replace_existing error behavior. The description's only contribution is grouping the four mutually-exclusive source parameters, which is marginal added value. Baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Add a document to a dataset') and enumerates the four accepted source modes, so the operation is unambiguous. It does not differentiate itself from siblings like ragflow_upload_file, ragflow_upload_attachment or ragflow_ingest_documents, leaving the agent to infer the boundary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The four source modes ('text, base64 bytes, a URL or an allowed local file') imply when this tool applies, and 'allowed local file' hints at a sandbox constraint. There is no explicit when-to-use guidance, no prerequisite statement (e.g. dataset must already exist), and no routing to alternative upload tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools