Skip to main content
Glama

add_knowledge_file

Add a local file's content to a knowledge base (txt/md/html/pdf/docx).

**This MCP runs on the platform server and cannot read paths on YOUR machine.** For text
files, read the content yourself and call `add_knowledge_text`; for binaries (pdf/docx),
upload via the console, or curl `/knowledge-bases/{name}/documents/upload`.

**To ingest a whole folder, zip it and send that one endpoint** — subdirectories are walked,
md/txt/pdf/html/docx are ingested one by one, and document names use the in-archive relative
path (`2025/rates.pdf` vs `2026/rates.pdf` therefore never collide). Images, `.DS_Store` etc.
inside the zip are ignored; if the archive contains an encrypted, corrupt or abnormally
high-compression file, **the whole archive is rejected** naming the offending entry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
titleNo
kb_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

No annotations are provided, so the description carries full burden. It richly discloses server-side execution, path constraints, zip walk behavior (including relative-path naming and collision avoidance), ignored file types, and whole-archive rejection on problematic entries. Context like "subdirectories are walked" and "the whole archive is rejected" goes far beyond a basic summary.

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?

The description is longer than average but every sentence adds critical operational detail, using bold for the most important caveats. It is front-loaded with the core purpose and then expands into necessary behavioral warnings. No filler or redundancy, though it could be tightened slightly without losing information.

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

Completeness5/5

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

Given the tool's complexity (server-side path limitation, binary vs text handling, folder ingestion via zip, archive edge cases), the description covers all relevant invocation scenarios. The output schema exists, so not detailing return values is acceptable. The only minor gap is silent on the optional title parameter, but that does not affect overall completeness for primary use cases.

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 coverage is 0% and the description does not explicitly define all three parameters. It compensates significantly for the 'path' parameter by explaining server-side path semantics, but does not mention the 'title' parameter's meaning or the exact role of kb_name beyond being inferable. It adds value but leaves optional parameter details undocumented.

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

Purpose5/5

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

The description opens with a specific verb+resource: "Add a local file's content to a knowledge base (txt/md/html/pdf/docx)." It clearly distinguishes itself from the sibling add_knowledge_text by explicitly recommending that tool for text files, making its own scope (binary-heavy formats and zip ingestion) unmistakable.

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

Usage Guidelines5/5

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

Provides explicit guidance: text files should be read and passed to add_knowledge_text, binaries should be uploaded via console or curl, and folders should be zipped. It also states the tool cannot read local machine paths, which is critical for correct invocation. This is exactly the when-to-use vs alternatives guidance expected.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources