Skip to main content
Tools in Open WebUI enable your AI models to perform specific actions and interact with external systems. They extend model capabilities beyond text generation to include API calls, file operations, calculations, and more.

Overview

Tools provide:
  • Python-based tool definitions
  • Integration with function calling models
  • Built-in code editor
  • Access control and permissions
  • User and admin valve configurations
  • OpenAPI tool server support
Tools are different from Functions. Tools are explicitly called by models that support function/tool calling, while Functions can filter or modify requests and responses.

Creating Tools

Via Web Interface

1

Access Tools Workspace

Navigate to Workspace → Tools in Open WebUI
2

Create New Tool

Click Create New Tool and configure:
  • ID: Unique identifier (lowercase, alphanumeric, underscores)
  • Name: Display name
  • Description: Tool purpose and usage
3

Implement Tool Logic

Write your tool code in the editor:
4

Save and Enable

Save the tool and ensure it’s active

Via API

Create tools programmatically:

Tool Structure

A tool must define a Tools class with one or more methods:
Method docstrings are important! They’re used to generate tool descriptions for the AI model.

Valves Configuration

Tools support configurable parameters through valves:

User Valves

Allow individual users to configure their own settings:

Managing Tools

List All Tools

Get Tool by ID

Update Tool

Delete Tool

Update Valves

Access Control

Tools support granular access control:

Tool Examples

Import from URL

Load tools from external sources:

Tool Servers

Open WebUI supports OpenAPI tool servers for enterprise integrations:
  • Configure tool server connections in admin settings
  • Tools are automatically discovered from OpenAPI specs
  • Supports authentication and access control
  • Compatible with MCP (Model Context Protocol) servers
Tool servers appear with the server: prefix in the tools list.

Best Practices

  1. Clear Documentation: Write detailed docstrings for all tool methods
  2. Type Hints: Use proper type annotations
  3. Error Handling: Handle exceptions gracefully
  4. Security: Validate inputs and sanitize outputs
  5. Performance: Keep tools fast and efficient
  6. Testing: Test tools thoroughly before deploying

Next Steps

  • Learn about MCP Servers for protocol-based integration
  • Explore Functions for request/response filtering
  • Configure Skills for reusable capabilities