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 aTools 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
Weather Tool
Weather Tool
File System Tool
File System Tool
Database Tool
Database Tool
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
- Clear Documentation: Write detailed docstrings for all tool methods
- Type Hints: Use proper type annotations
- Error Handling: Handle exceptions gracefully
- Security: Validate inputs and sanitize outputs
- Performance: Keep tools fast and efficient
- 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