tools
Tool Inventory Router.
This module contains the API routes for managing tools in the tool inventory. It provides endpoints for creating, reading, and updating tools.
create_tool
async
¶
Create a new tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tool
|
ToolCreate
|
The tool creation model. |
required |
Returns:
| Type | Description |
|---|---|
Tool
|
The created tool. |
Source code in src/tool_inventory/routers/tools.py
get_tool_by_id
async
¶
Get a tool by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tool_id
|
UUID
|
The UUID of the tool. |
required |
Returns:
| Type | Description |
|---|---|
Tool
|
The tool with the specified ID. |
Source code in src/tool_inventory/routers/tools.py
get_tools
async
¶
Get tools by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
The name of the tool to filter by. |
None
|
Returns:
| Type | Description |
|---|---|
list[Tool]
|
A list of tools. |
Source code in src/tool_inventory/routers/tools.py
update_tool
async
¶
Update an existing tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tool_id
|
UUID
|
The UUID of the tool to update. |
required |
tool_patch
|
ToolPatch
|
The tool patch model. |
required |
Returns:
| Type | Description |
|---|---|
Tool
|
The updated tool. |