Skip to main content

Create Tool

Create a new tool. Requires workspace.tools or workspace.tools_import permission for non-admin users.

Request Body

string
required
Unique identifier for the tool. Must be alphanumeric with underscores only (will be converted to lowercase).
string
required
Display name for the tool
string
required
Python source code for the tool. Must define a Tools class with tool methods. The system will:
  • Replace imports with internal versions
  • Load and validate the tool module
  • Extract tool specifications from the class
  • Parse frontmatter manifest
object
required
Tool metadata
array
Access control configuration

Response

Returns the created ToolResponse object with ID, metadata, and specifications.

Get Tool by ID

Retrieve a specific tool by ID. Requires read access to the tool.

Path Parameters

string
required
The tool identifier

Response

Returns ToolAccessResponse with the complete tool data and write_access flag.

Update Tool

Update an existing tool. Requires write access (creator, admin, or write grant).

Request Body

Same as Create Tool request body.

Update Tool Access

Update access control for a tool. Requires write access.

Request Body

array
required
Array of access grant objects. Replaces existing grants.
Note: Public sharing grants are filtered based on sharing.public_tools permission.

Delete Tool

Delete a tool. Requires write access. Also removes the tool from cache and revokes all access grants.

Response

boolean
true if deletion was successful, false otherwise

Valve Management

Get Tool Valves

Retrieve the current valve configuration for a tool.

Get Valves Schema

Retrieve the valve schema definition (if the tool defines a Valves class).

Update Tool Valves

Update valve configuration. Requires write access.

User Valves

Get User Valves

Retrieve user-specific valve values for the authenticated user.

Get User Valves Schema

Retrieve the user valve schema definition (if the tool defines a UserValves class).

Update User Valves

Update user-specific valve values. Stored in user settings.

Load Tool from URL

Load a tool from a GitHub URL. Supports both file and folder URLs. Requires admin privileges.

Request Body

string
required
GitHub URL to the tool file or folder. URLs are automatically converted to raw.githubusercontent.com format.

Response

string
Suggested tool name extracted from the filename/folder
string
Tool source code

Python Tool Pattern

Tools should follow this pattern:
The system automatically:
  • Extracts tool specifications from the Tools class methods
  • Parses frontmatter as manifest
  • Validates valve schemas
  • Generates API documentation from docstrings

Error Responses

400 Bad Request
  • Invalid tool ID format
  • Tool ID already exists
  • Invalid Python code
  • Failed to load tool module
401 Unauthorized
  • Missing authentication
  • Insufficient permissions
404 Not Found
  • Tool does not exist

Authentication & Permissions

  • Most operations require verified user authentication
  • Creating tools requires workspace.tools or workspace.tools_import permission
  • Exporting tools requires workspace.tools_export permission
  • Write operations require tool ownership, write grant, or admin privileges
  • Loading from URL requires admin privileges