Skip to main content
Glama

Read a file into the knowledge base

add_knowledge_from_file

Reads an already uploaded PDF, image or text file and stores what it says so it can be searched. Give it a media id from an upload.

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": {
      "mediaId": "<mediaId>"
    },
    "name": "add_knowledge_from_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
titleNoA name for it. Defaults to the file name.
mediaIdYesMedia id from an upload tool.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare the write, non-idempotent, open-world profile, lowering the burden. The description adds the useful outcome ('stores what it says so it can be searched') but does not address what happens when the same file is added twice, despite non-idempotentHint=false, nor any cost or credit implications.

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

Conciseness5/5

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

Two short sentences, zero filler, and the core action is front-loaded. The prerequisite follows immediately with nothing wasted.

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

Completeness4/5

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

For a simple two-parameter write tool with full schema documentation and annotations covering safety, the description covers source, prerequisite and outcome. The remaining gap is duplicate/repeat-add behavior, which matters given the non-idempotent declaration.

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 both parameters are already documented in the schema. The single extra hint — that mediaId comes from an upload — is marginal, so 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: reads an already-uploaded PDF/image/text file and stores its content for search. It implicitly separates itself from the URL-based sibling by stressing 'already uploaded' and 'media id from an upload', but it never names add_knowledge or add_knowledge_from_url explicitly.

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

Usage Guidelines4/5

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

The phrase 'Give it a media id from an upload' supplies a clear prerequisite — the file must be uploaded first via one of the upload siblings. It gives context for when to use it but offers no explicit exclusions or named alternatives (e.g. use add_knowledge_from_url for URLs).

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