Skip to main content

List Tools

Returns all tools for the authenticated user's agency from the local agency_tools database table. Supports filtering by tool type, category, and active status.

Endpoint

PropertyValue
Function Nametools-list
HTTP MethodGET
AuthenticationSupabase JWT (Bearer token)
Required RoleAny authenticated agency user

Request

Headers

Authorization: Bearer <supabase_jwt_token>

Query Parameters

FieldTypeRequiredDescription
tool_typestringNoFilter by tool type. Possible values: http, client, dataConnection
categorystringNoFilter by category
active_onlystringNoIf "false", include inactive tools. Defaults to "true"

Response

Success (200)

{
"tools": [
{
"id": "local-uuid",
"ultravox_tool_id": "ultravox-tool-uuid",
"name": "my-tool",
"description": "Tool description",
"tool_type": "http",
"ownership": "user",
"created_at_ultravox": "2025-01-01T00:00:00Z",
"definition": { },
"http_base_url": "https://api.example.com/endpoint",
"http_method": "POST",
"dynamic_parameters": [],
"static_parameters": [],
"category": "general",
"tags": ["tag1", "tag2"],
"icon": "wrench",
"is_active": true,
"managed_by_virsyn": false,
"last_synced_at": "2025-01-15T12:00:00Z",
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-15T12:00:00Z"
}
],
"total": 1,
"last_synced_at": "2025-01-15T12:00:00Z",
"sync_recommended": false
}

The sync_recommended field is true when the tools list is empty or the last sync was more than 24 hours ago.

Error Responses

StatusCondition
401Missing or invalid authorization header
403User is not an agency user
405HTTP method is not GET
500Database query failed

Behavior

  • Authenticates the user via Supabase JWT and verifies they belong to an agency
  • Queries the agency_tools table filtered by the user's agency_id, ordered by name
  • Applies optional filters for tool_type, category, and is_active (active-only by default)
  • Returns all matching tool records with their full field set
  • Checks the last_synced_at timestamp and sets sync_recommended: true if the data is empty or older than 24 hours

Database Tables Read

TableOperationPurpose
usersReadResolve agency membership
agency_toolsReadRetrieve tools for the agency
  • Get Tool -- Retrieve a single tool by ID with optional refresh from Ultravox
  • Sync Tools -- Sync all tools from Ultravox into the local database