Open WebUI Tools give your self-hosted AI hands. With a tool enabled, a model can fetch live data, call an API, do exact maths or run custom Python, instead of guessing from its training data. Most people start by importing a community tool, then move on to writing small tools of their own.
The word “tool” covers several things in Open WebUI: built-in system tools, Python Workspace Tools, MCP servers and OpenAPI servers. Knowing which one you need saves a lot of confusion, and so does knowing that native function calling is now the default and the only supported mode.
This guide covers the tool types, importing and enabling Workspace Tools, Valves, writing your first tool, native mode, tool approval, Tool Search, security, and fixes for the most common problems. It follows the official Open WebUI documentation as of December 2026.
- Install: openwebui.com > pick a tool > Get > enter your instance URL > Import to WebUI.
- Use: + menu > Tools for one chat, or Workspace > Models > Tools for every chat.
- Mode: Native (Agentic) function calling is the default; Legacy is unsupported.
- Settings: Valves hold admin settings like API keys; UserValves are per-user switches in Controls.
- Security: Workspace Tools run Python on your server. Only trusted admins should create or import them.
- Models: use a current tool-calling model; small local models often produce broken JSON.
Which Kind of Tool Do You Need?
| Type | Where in the UI | Best for |
|---|---|---|
| Native features | Admin settings | Built-in web search, URL fetch, image generation, memory, knowledge |
| Workspace Tools | Workspace > Tools | Custom or community Python, the most powerful option |
| Native MCP (HTTP) | Settings > Integrations | MCP servers with a Streamable HTTP endpoint |
| MCP via MCPO | Settings > Integrations | Local stdio MCP servers, bridged by the MCPO proxy |
| OpenAPI servers | Settings > Integrations | Any REST service with an OpenAPI spec |
MCP and OpenAPI servers run in a separate process and are called over HTTP.
Workspace Tools run inside Open WebUI with full Python and access to the request context, so they can do almost anything, including holding API keys server-side where neither the user nor the model can read them.
For MCP setup, follow our Open WebUI MCP guide. This guide focuses on Workspace Tools.
Import a Tool From the Community
If Open WebUI is not running yet, start with our Open WebUI with Ollama setup guide. Workspace Tools need ENABLE_TOOLS, which is on by default.
- Open the community library at openwebui.com and search for a tool, such as a weather, calculator or Wikipedia tool.
- Read the code before you import it. It will run on your server.
- Click Get.
- Enter your instance URL, for example
http://localhost:3000. - Click Import to WebUI. The tool opens in the editor on your instance.
- Review it and save. It now appears in Workspace > Tools.
You can also click Create in Workspace > Tools and paste code yourself.
Turn Tools On in a Chat or Model
For one chat: open the + menu in the input area, choose Tools, and switch on the tools you want for that session.
For every chat with a model:
- Go to Workspace > Models and edit the model.
- Open the Tools row and pick the tools it should always have.
- Click Save.
In native mode the model decides on each turn which attached tool to call. Watch out: attaching a tool to a shared model does not give users access to it. Each user needs read access to the tool, or the model silently cannot call it.
Our Open WebUI users, groups and permissions guide shows how to grant it.
Set Valves and UserValves
Valves are a tool’s settings, shown as text fields, number boxes, dropdowns or switches.
| Valves | UserValves | |
|---|---|---|
| Who sets them | The tool’s owner, admins and anyone with write access | Each user, for themselves |
| Where | The gear icon on the tool in Workspace > Tools | Model controls > Controls > Valves in a chat |
| Typical use | Shared API key, base URL, limits | Personal API key, units, on/off options |
Anyone you give write access can read a tool’s Valves, so keep that in mind when you share a tool that holds a key. The Controls section lists only enabled tools.
Write Your First Tool
A tool is a Python file with a top docstring and a class called Tools. Every public method becomes a tool the model can call.
"""
title: String Inverse
description: Reverses a string
version: 0.1.0
"""
from pydantic import BaseModel, Field
class Tools:
def __init__(self):
self.valves = self.Valves()
class Valves(BaseModel):
prefix: str = Field("", description="Text added before the result")
async def reverse_string(self, string: str) -> str:
"""
Reverses the input string.
:param string: The string to reverse
"""
return self.valves.prefix + string[::-1]
Rules that matter:
- Set
self.valves = self.Valves()in__init__. Without it, saved Valves never load and the tool always uses defaults. - Helper methods start with
_. Any other public method is exposed to the model. - Docstrings are the model’s manual. Text above the first
:paramis the tool description, and each:param name:describes an argument. Google-styleArgs:blocks are not parsed. - Type-hint every argument. Hints build the JSON schema. An argument without one becomes a string.
- Prefer async. Use async HTTP clients and run unavoidable blocking work with
await anyio.to_thread.run_sync(...). - Extra packages go in a
requirements:line in the top docstring.
When you paste code into a new tool, the editor fills in Name, ID and Description from title and description.
With native mode and the Tool Creation category on, users with Tools Access can even ask a model to write a tool from chat with create_tool. For filters and pipes, see our Open WebUI Functions guide.
Native Mode and Built-in Tools
The setting lives in Model Settings > Advanced Params > Function Calling. Native Mode (Agentic Mode) is the default and the only supported mode. Legacy Mode, the old prompt-based method, gets no fixes or new features and does not work with built-in memory, notes, knowledge, channels or research tools.
In native mode Open WebUI also injects built-in system tools when the related feature is on:
| Group | Example tools |
|---|---|
| Search and web | search_web, fetch_url (needs web search on) |
| Knowledge | query_knowledge_files, grep_knowledge_files, view_knowledge_file |
| Memory | add_memory, search_memories |
| Notes and skills | search_notes, view_skill |
| Tool creation | create_tool |
Each group can be switched on or off per model under Builtin Tools. Admins can cap how much of any tool result reaches the model with Tool Output Limit (TOOL_OUTPUT_MAX_CHARS). Related guides: Open WebUI web search and Open WebUI Memory.
Tool Approval
By default, tool calls run as soon as the model makes them. Admins can turn on Tool Permissions in Settings > Interface (ENABLE_TOOL_PERMISSIONS, experimental, off by default). The + menu then gains a Tool Permissions entry:
- Full access: calls run immediately.
- Ask for approval: the reply pauses at each call with Allow and Deny. Shortcuts are Cmd+Alt+Enter and Cmd+Alt+Backspace.
- Auto: each call is checked against an approval policy, and only risky ones wait for you. Needs
ENABLE_TOOL_PERMISSIONS_AUTO.
A denied call is sent back to the model as an error so it can adjust. Channel replies always run with full access.
Tool Search for Many Tools
With dozens of tools enabled, their definitions alone can fill much of every request. Tool Search (Settings > Interface > Chat, ENABLE_TOOL_SEARCH, experimental) keeps large definitions out until needed.
- Tools whose definition is longer than the Deferral Threshold (default 400 characters) are deferred.
- The model gets
search_toolsto find them (5 results by default, up to 20) andcall_toolto run them. - Always Loaded Tools takes names or patterns such as
github_*to keep key tools in full. - The search engine can be BM25 (default), Embeddings or a Decisions API.
Versions, Sharing and Turning Tools Off
- Turn off: the switch on a tool’s row disables it everywhere, even in chats that already selected it, and skips installing its requirements.
- Share: the … menu > Access (non-admins need the Tools Sharing permission).
- Version history: every save with a note in Describe this change is kept. Open an old version, Compare to current, or Set as Production. Valves and access stay as they are when you switch versions.
- Translate: the globe selector stores names, descriptions and valve labels per language.
Security Rules
- Workspace Tools and Functions run arbitrary Python on your server. Letting a user create or import tools is the same as giving them shell access.
- Only install tools from sources you trust, and read the code first.
- Keep the Workspace Tools permission for trusted admins only.
- Store shared keys in Valves rather than in the code, and remember that write access reveals Valves.
- For untrusted code, use a sandbox such as the code interpreter or Open Terminal instead of a Workspace Tool.
Models That Call Tools Well
Agentic tool calling needs a current model, not an expensive one. The Open WebUI docs list GPT-5.6 Luna, Gemini 3.5 Flash-Lite, MiniMax M3 and DeepSeek V4 Flash as a solid minimum online.
Locally, Muse Glimmer 30B and Qwen 3.6 27B are named, and Muse Glimmer runs agentic loops reliably on one 24 GB GPU. Models under about 30B often produce malformed JSON or break multi-step chains. DeepSeek V3.2 has known native function calling failures. See our best Ollama models list for local options.
Troubleshooting
The model never calls my tool
Check the tool is enabled in the chat or model, function calling is Native, and the docstring clearly says when to use it. Try a stronger model.
Other users cannot use a tool attached to a shared model
They need read access to the tool itself. Grant it through Access, a group, or public sharing.
My Valves are ignored
Add self.valves = self.Valves() to __init__. Without it the tool runs on class defaults.
“Current Valves are incompatible with this code”
The version you are restoring expects different Valves. Adjust the Valves first, then set it as Production.
Tool calls return malformed JSON
The model is too small or weak at function calling. Switch to a current tool-calling model.
Blank replies when a tool is used
Some OpenAI-compatible endpoints drop streamed tool calls. Use a connection that follows the OpenAI streaming schema.
A helper function shows up as a tool
Rename it to start with _.
FAQ
Are Open WebUI Tools free?
Yes. Tools and the community library are free; any paid API a tool calls is billed by that provider.
Do tools work with Ollama models?
Yes, with a local model that supports function calling well, such as Qwen 3.6 27B.
What is the difference between Tools and Functions?
Tools are called by the model during a chat. Functions (pipes, filters, actions) change how Open WebUI itself handles requests.
Should I use a Workspace Tool or an MCP server?
Use MCP or OpenAPI to reuse an existing server or keep code isolated. Use a Workspace Tool for maximum control inside Open WebUI.
Can tools hold secret API keys?
Yes. Valves keep keys on the server, hidden from users and the model, though anyone with write access can read them.
Is Legacy mode still available?
Yes, as an opt-out, but it is unsupported and breaks many built-in features.
Can I write a tool without coding?
With native mode and Tools Access, you can ask a capable model to write one with create_tool, then review the code.



