Skip to content

Register Custom Edge Function Tool

POST
/api/v3/organizations/{organisation}/ai/custom-tools

Registers a custom edge function as a tool that AI models can invoke. This enables customers to create their own tools backed by edge functions. * * Edge Function Contract: * - Edge functions must accept POST requests with JSON payload * - Expected request format: { 'toolName': '...', 'input': {...}, 'orgId': '...' } * - Must return JSON response with either result or error field * * Async Tools: * Set isAsync: true for operations >5 seconds. The edge function should return { executionId: '...' } and the AI will poll for completion.

Authorizations

Parameters

Path Parameters

organisation
required
string

The organisation ID

Request Body required

object
name
required

Unique tool name (alphanumeric and underscores only)

string
check_inventory
description
required

Human-readable description of what the tool does

string
Check product inventory levels in warehouse
edgeFunctionUrl
required

HTTPS URL of the edge function

string
https://inventory-api.my-project.quant.cloud
inputSchema
required

JSON Schema defining the tool’s input parameters

object
isAsync

Whether this tool runs asynchronously (>5 seconds)

boolean
timeoutSeconds

Tool execution timeout

integer
default: 30 >= 5 <= 300

Responses

201

Custom tool registered successfully

object
success
boolean
true
tool
object
message
string
Custom tool registered successfully

400

Invalid request parameters

403

Access denied

409

Tool with this name already exists

500

Failed to register custom tool