tools
Classes
ToolsClient
ToolsClient(client: OWUIClientBase)
Bases: ResourceBase
Client for the Tools endpoints.
- Code Reference client Classes OpenWebUI Attributes tools
Source code in src/owui_client/client_base.py
Functions
get_tools
get_tools() -> List[ToolUserResponse]
Get all available tools.
This includes local tools and tools from configured servers (OpenAPI, MCP).
Returns:
| Type | Description |
|---|---|
List[ToolUserResponse]
|
List[ToolUserResponse]: List of tools with user information. |
Source code in src/owui_client/routers/tools.py
get_tool_list
get_tool_list() -> List[ToolUserResponse]
Get list of tools the user has write access to.
Returns:
| Type | Description |
|---|---|
List[ToolUserResponse]
|
List[ToolUserResponse]: List of tools. |
Source code in src/owui_client/routers/tools.py
load_tool_from_url
load_tool_from_url(
form_data: LoadUrlForm,
) -> Optional[Dict[str, Any]]
Load a tool's code and metadata from a URL.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
LoadUrlForm
|
The URL information. |
required |
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
Optional[Dict[str, Any]]: A dictionary containing 'name' and 'content' of the tool, or None if failed. |
Source code in src/owui_client/routers/tools.py
export_tools
export_tools() -> List[ToolModel]
Export all tools the user has read access to.
Returns:
| Type | Description |
|---|---|
List[ToolModel]
|
List[ToolModel]: List of tools with full content. |
Source code in src/owui_client/routers/tools.py
create_new_tool
create_new_tool(
form_data: ToolForm,
) -> Optional[ToolResponse]
Create a new tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
ToolForm
|
The tool data, including ID, name, and Python content. |
required |
Returns:
| Type | Description |
|---|---|
Optional[ToolResponse]
|
Optional[ToolResponse]: The created tool metadata. |
Source code in src/owui_client/routers/tools.py
get_tool_by_id
get_tool_by_id(id: str) -> Optional[ToolModel]
Get a tool by its unique ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The tool ID. |
required |
Returns:
| Type | Description |
|---|---|
Optional[ToolModel]
|
Optional[ToolModel]: The tool details. |
Source code in src/owui_client/routers/tools.py
update_tool_by_id
Update a tool by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The tool ID. |
required |
form_data
|
ToolForm
|
The updated tool data. |
required |
Returns:
| Type | Description |
|---|---|
Optional[ToolModel]
|
Optional[ToolModel]: The updated tool details. |
Source code in src/owui_client/routers/tools.py
delete_tool_by_id
Delete a tool by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The tool ID. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if successful, False otherwise. |
Source code in src/owui_client/routers/tools.py
get_tool_valves_by_id
Get the current valve settings for a tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The tool ID. |
required |
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
Optional[Dict[str, Any]]: The valve settings. |
Source code in src/owui_client/routers/tools.py
get_tool_valves_spec_by_id
Get the specification (schema) for the tool's valves.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The tool ID. |
required |
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
Optional[Dict[str, Any]]: The JSON schema for the valves. |
Source code in src/owui_client/routers/tools.py
update_tool_valves_by_id
Update the valve settings for a tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The tool ID. |
required |
valves
|
Dict[str, Any]
|
The new valve settings. |
required |
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
Optional[Dict[str, Any]]: The updated valve settings. |
Source code in src/owui_client/routers/tools.py
get_tool_user_valves_by_id
Get user-specific valve settings for a tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The tool ID. |
required |
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
Optional[Dict[str, Any]]: The user's valve settings. |
Source code in src/owui_client/routers/tools.py
get_tool_user_valves_spec_by_id
Get the specification (schema) for the tool's user valves.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The tool ID. |
required |
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
Optional[Dict[str, Any]]: The JSON schema for the user valves. |
Source code in src/owui_client/routers/tools.py
update_tool_user_valves_by_id
Update user-specific valve settings for a tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The tool ID. |
required |
valves
|
Dict[str, Any]
|
The new valve settings. |
required |
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
Optional[Dict[str, Any]]: The updated valve settings. |