# Tool Reference
This document provides a detailed reference for all tools available in the `open-webui-mcp` server.
## Project Management
### `list_projects`
List all projects defined in `projects.json`.
**Input:** None
**Output:**
An array of project summaries:
```json
[
{
"id": "project-1",
"name": "My Project",
"description": "A sample project",
"folder_id": "folder-uuid",
"updated_at": "2024-02-19T12:00:00Z"
}
]
```
### `get_project_config`
Get the full configuration for a specific project, including system prompts, knowledge base references, and notes.
**Input:**
- `project_id` (string, required): The unique ID of the project.
**Example:**
```json
{
"project_id": "project-1"
}
```
### `update_project_system_prompt`
Update the system prompt for a project.
**Input:**
- `project_id` (string, required): The unique ID of the project.
- `content` (string, required): The new system prompt content.
- `mode` (string, optional): Update mode. Either `replace` (default) or `append`.
**Example:**
```json
{
"project_id": "project-1",
"content": "You are a helpful assistant specialized in TypeScript.",
"mode": "replace"
}
```
### `set_active_project`
Link a specific chat to a project's folder in OpenWebUI.
**Input:**
- `chat_id` (string, required): The ID of the chat.
- `project_id` (string, required): The ID of the project to activate.
**Example:**
```json
{
"chat_id": "chat-uuid",
"project_id": "project-1"
}
```
## Notes Management
### `list_project_notes`
List all notes associated with a project.
**Input:**
- `project_id` (string, required): The unique ID of the project.
**Output:**
An array of note summaries.
### `create_project_note`
Create a new note and link it to a project. The note title will be automatically prefixed with `[project:{project_id}]`.
**Input:**
- `project_id` (string, required): The unique ID of the project.
- `title` (string, required): The title of the note.
- `content` (string, required): The content of the note.
**Example:**
```json
{
"project_id": "project-1",
"title": "Architecture Overview",
"content": "This project uses a microservices architecture..."
}
```
### `update_project_note`
Update an existing note linked to a project.
**Input:**
- `project_id` (string, required): The unique ID of the project.
- `note_id` (string, required): The ID of the note to update.
- `title` (string, optional): The new title.
- `content` (string, optional): The new content.
## Knowledge Base Management
### `list_knowledge_bases`
List all available knowledge bases in OpenWebUI.
**Input:** None
### `associate_kb`
Associate an existing knowledge base with a project.
**Input:**
- `project_id` (string, required): The unique ID of the project.
- `knowledge_id` (string, required): The ID of the knowledge base.
### `disassociate_kb`
Remove a knowledge base association from a project.
**Input:**
- `project_id` (string, required): The unique ID of the project.
- `knowledge_id` (string, required): The ID of the knowledge base.
### `add_file_to_kb`
Upload a local file and add it to a specific knowledge base.
**Input:**
- `project_id` (string, required): The unique ID of the project (for audit logging).
- `knowledge_id` (string, required): The ID of the knowledge base.
- `file_path` (string, required): The local path to the file.
## Safety & Updates (Propose/Evaluate/Apply)
The server implements a three-step safety model for updating project configurations based on conversations.
### `propose_updates_from_conversation`
Analyze a chat conversation and propose updates to the project (system prompt, notes, or knowledge bases).
**Input:**
- `project_id` (string, required): The unique ID of the project.
- `chat_id` (string, required): The ID of the chat to analyze.
- `summary` (string, optional): A human-provided summary of the changes.
**Output:**
A `ProposedChangeSet` object.
### `evaluate_proposed_updates`
Use an LLM (via OpenRouter) to evaluate the safety and relevance of a proposed change set.
**Input:**
- `change_set` (object, required): The `ProposedChangeSet` to evaluate.
- `context` (string, optional): Additional context for the evaluation.
**Output:**
An evaluation result with a score (0-1) and a normalized change set.
### `apply_project_updates`
Apply an approved change set to the project.
**Input:**
- `change_set` (object, required): The `ProposedChangeSet` to apply.
- `options` (object, optional):
- `allow_stale_apply` (boolean): Apply even if the project state has changed since the proposal.
**Output:**
A summary of applied, skipped, and failed operations.