---
title: "Knowledge bases"
description: "Reference content the agent retrieves during calls."
---

> **For AI agents:** the complete documentation index is at [llms.txt](https://docs.trillet.ai/llms.txt). Append `.md` to any page URL for its markdown version.

{/* Generated by packages/mcp/scripts/gen-tool-reference.mjs from @trillet-ai/mcp v0.10.0. Do not edit by hand. */}

Reference content the agent retrieves during calls. 7 tools.

## `trillet_list_knowledge_bases`

**List knowledge bases**

List the workspace's knowledge bases: id, name, description, file/text presence.

Flags: `read-only` `structured output`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | string | no | Run this call in another workspace: its id or its name (see trillet_list_workspaces). Omit to use the default (TRILLET_WORKSPACE_ID, the workspace picked when the connector was approved, or the one set with trillet_switch_workspace). |

### Structured output

Returned as `structuredContent` (fields are optional; the same data is in the text result, where it is a bare array):

| Field | Type | Description |
| --- | --- | --- |
| `knowledgeBases` | object[] |  |

## `trillet_get_knowledge_base`

**Get knowledge base**

Fetch one knowledge base (metadata + file list), optionally with which call flows use it (include_usage).

Flags: `read-only` `structured output`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `knowledge_base_id` | string | yes |  |
| `include_usage` | boolean | no | Default: `false`. |
| `workspace_id` | string | no | Run this call in another workspace: its id or its name (see trillet_list_workspaces). Omit to use the default (TRILLET_WORKSPACE_ID, the workspace picked when the connector was approved, or the one set with trillet_switch_workspace). |

### Structured output

Returned as `structuredContent` (fields are optional; the same data is in the text result):

| Field | Type | Description |
| --- | --- | --- |
| `knowledgeBase` | any |  |
| `usage` | any |  |

## `trillet_delete_knowledge_base`

**Delete knowledge base (or one file)**

Delete an entire knowledge base, or just one file from it when file_key is given. Check usage first (trillet_get_knowledge_base include_usage=true): flows still pointing at a deleted KB lose retrieval. Always confirm with the user; requires confirm=true.

Flags: `writes` `destructive` `asks for confirmation`

Clients that support MCP elicitation show a confirmation form before this tool runs; declining cancels it with no changes. Other clients rely on their own approval prompt and the `confirm` argument.

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `knowledge_base_id` | string | yes |  |
| `file_key` | string | no | Delete only this file (fileKey) instead of the whole KB |
| `confirm` | boolean | yes | Must be true. Only set after the user explicitly approved the deletion. |
| `workspace_id` | string | no | Run this call in another workspace: its id or its name (see trillet_list_workspaces). Omit to use the default (TRILLET_WORKSPACE_ID, the workspace picked when the connector was approved, or the one set with trillet_switch_workspace). |

## `trillet_create_knowledge_base`

**Create knowledge base**

Create an empty knowledge base. Add content with trillet_add_kb_text or trillet_upload_kb_file, then attach it to a call flow with trillet_attach_knowledge_bases.

Flags: `writes`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | yes |  |
| `description` | string | no |  |
| `workspace_id` | string | no | Run this call in another workspace: its id or its name (see trillet_list_workspaces). Omit to use the default (TRILLET_WORKSPACE_ID, the workspace picked when the connector was approved, or the one set with trillet_switch_workspace). |

## `trillet_add_kb_text`

**Add text to knowledge base**

Add plain-text content to a knowledge base. The text is chunked and vector-embedded immediately.

Flags: `writes`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `knowledge_base_id` | string | yes |  |
| `text` | string | yes | The content to embed |
| `name` | string | no | Label for this text block |
| `workspace_id` | string | no | Run this call in another workspace: its id or its name (see trillet_list_workspaces). Omit to use the default (TRILLET_WORKSPACE_ID, the workspace picked when the connector was approved, or the one set with trillet_switch_workspace). |

## `trillet_upload_kb_file`

**Upload file to knowledge base**

Upload a file (PDF, DOCX, TXT, MD, CSV, JSON) to a knowledge base from ONE source: file_path (a file on this computer; local installs only), file_url (a public https link), or file_base64 + file_name (the file's bytes, up to 2.5MB). Text is extracted and vector-embedded synchronously in the same request. For plain text, trillet_add_kb_text is simpler. GOTCHA: each knowledge base holds ONE file; uploading replaces the existing file. Use separate knowledge bases for separate documents.

Flags: `writes` `destructive`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `knowledge_base_id` | string | yes |  |
| `file_path` | string | no | Absolute path to a local file (not available on the hosted server) |
| `file_url` | string | no | Public https URL of the file (max 20MB, no redirects) |
| `file_base64` | string | no | Base64 file contents (max 2.5MB); requires file_name |
| `file_name` | string | no | File name with extension, e.g. faq.pdf (required with file_base64, optional with file_url) |
| `workspace_id` | string | no | Run this call in another workspace: its id or its name (see trillet_list_workspaces). Omit to use the default (TRILLET_WORKSPACE_ID, the workspace picked when the connector was approved, or the one set with trillet_switch_workspace). |

## `trillet_attach_knowledge_bases`

**Attach knowledge bases to call flow**

Set the COMPLETE list of knowledge base ids on a call flow (the list replaces the previous one; pass an empty array to detach all). The runtime automatically retrieves relevant content during calls.

Flags: `writes` `destructive` `idempotent` `structured output`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `flow_id` | string | yes |  |
| `knowledge_base_ids` | string[] | yes |  |
| `workspace_id` | string | no | Run this call in another workspace: its id or its name (see trillet_list_workspaces). Omit to use the default (TRILLET_WORKSPACE_ID, the workspace picked when the connector was approved, or the one set with trillet_switch_workspace). |

### Structured output

Returned as `structuredContent` (fields are optional; the same data is in the text result):

| Field | Type | Description |
| --- | --- | --- |
| `id` | string |  |
| `knowledgeBases` | any[] |  |
