Skip to main content
Glama
Unilytics MCP Server

Unilytics MCP Server

Official

kb_add_file

Create a knowledge base document from an uploaded file or public HTTPS link, then extract, chunk, and embed its text. Add PDFs, Office files, CSV, TXT, or MD to a collection.

Instructions

Create a KB document from a file: either one already uploaded (signed_id) or one at a public https link (url). Exactly one of the two.

signed_id: step 2 of a two-step upload, for a file already PUT to the upload_url from
kb_create_direct_upload; `name` is required with it.

url: Unilytics downloads the file from the link (a PDF, DOCX, PPTX, XLSX, XLS, CSV, TXT or MD file
up to 100 MB, redirects followed, public https addresses only) and stores the original, as an
upload would. The type comes from the response (its name, its Content-Type and the file's own
bytes), never from the link alone: a web page, a login page or a file of another type is refused
(kb_add_urls adds a web page). `name` defaults to the file's own name; document_type, when given,
is the type the file must be. request_id (a UUID, optional) makes the call repeatable: a repeat
with the same request_id and arguments within 24 hours returns the first call's document (free)
instead of adding the file again, and a request_id used for different arguments is refused.
Without it, each call adds a new copy. The result's `file` holds the stored name, file_type and
bytes.

The file's full text is extracted, chunked and embedded in the background. Returns {document_id,
status}; kb_get_status reports progress. A file that can't be read, or holds more text than one
document can (about 5 million characters), ends as status 'failed' with `error` saying why; it
keeps its document_id, and kb_retry_document re-runs it in place.

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": {
      "project_id": "<project_id>",
      "collection_id": "<collection_id>"
    },
    "name": "kb_add_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNo
nameNo
metadataNo
signed_idNo
project_idYes
request_idNo
collection_idYes
document_typeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv1.1.2
    • addedInput schema / properties / name / default
      Added value: +null
    • addedInput schema / properties / request_id
      Added value: +{
      +  "default": null,
      +  "title": "Request Id",
      +  "type": "string"
      +}
    • addedInput schema / properties / signed_id / default
      Added value: +null
    • addedInput schema / properties / url
      Added value: +{
      +  "default": null,
      +  "title": "Url",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "project_id",
      -  "collection_id",
      -  "signed_id",
      -  "name"
      -]New value: +[
      +  "project_id",
      +  "collection_id"
      +]
  2. Changed1 schema field changedv1.1.0
    • removedInput schema / properties / config
      Removed value: -{
      -  "default": null,
      -  "title": "config",
      -  "type": "string"
      -}
  3. First observedv1.0.0

TDQS

A4.6/5.0
Behavior4/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 the description adds substantial context beyond them: 100 MB cap, supported formats, redirect following, that type is verified from bytes/Content-Type rather than the link, background extraction/chunking, and a ~5M character failure ceiling with document_id retention. The request_id semantics explain that idempotencyHint=false is the default path yet an opt-in repeat is available. It does not say whether an added file can be superseded/overwritten or what permissions/quotas apply.

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?

Front-loaded with the core decision (which source), then branching detail, then outcomes; every sentence is substantive with no filler. It is long (~280 words) and the two long parentheticals about type detection and download rules could be tightened, but the density justifies most of the length.

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?

For an eight-parameter, no-output-schema tool, the description supplies the return shape ({document_id, status}), the `file` payload fields (name, file_type, bytes), progress reporting via kb_get_status, and the failure path including recovery via kb_retry_document. Only the undocumented metadata/project/collection parameters are an omission, and those are largely obvious identifiers.

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

Parameters4/5

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

Schema coverage is 0%, so the description must carry the load, and it explains url, signed_id, name (its role and its default to the file's own name), document_type (a validation constraint rather than a hint), and request_id (UUID, 24-hour replay window, argument-mismatch refusal). metadata, project_id and collection_id are never mentioned, leaving three of eight parameters — including the nested object — undocumented anywhere.

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?

Opens with a specific verb+resource ('Create a KB document from a file') and immediately narrows scope to two mutually exclusive sources (signed_id vs url). It differentiates itself from named siblings: kb_add_urls is explicitly the tool for web pages, and kb_create_direct_upload is identified as the preceding step.

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?

States an explicit selection rule ('Exactly one of the two') plus per-branch preconditions: signed_id requires a prior PUT to the upload_url from kb_create_direct_upload and requires `name`; url requires a public https address. It also routes follow-up work to kb_get_status and kb_retry_document and names the alternative for non-file links.

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