Functions

Functions are reusable code blocks that perform specialized tasks. Agents or external calls can invoke these functions to automate complex operations effortlessly.

List functions

get

Retrieve all functions created on the platform. Functions can be linked to agents to enable specialized operations.

Responses
chevron-right
200

List of functions retrieved successfully.

application/json
idstringOptionalExample: function_abcde
namestringOptionalExample: analyzeMarket
descriptionstringOptionalExample: Analyzes market data and returns insights.
codestringOptionalExample: function analyzeMarket(data) { /* ... */ }
get
/functions

Create a function

post

Add a new function that can be executed by an agent.

Body
namestringRequired
descriptionstringOptional
codestringOptional

Actual code for the function.

Responses
post
/functions

Fetch function by ID

get

Retrieve details about a specific function, including its code, parameters, and usage statistics.

Path parameters
idstringRequired

The unique identifier of the function.

Responses
chevron-right
200

Function details retrieved successfully.

application/json
idstringOptionalExample: function_abcde
namestringOptionalExample: analyzeMarket
descriptionstringOptionalExample: Analyzes market data and returns insights.
codestringOptionalExample: function analyzeMarket(data) { /* ... */ }
get
/functions/{id}

Update a function

patch

Edit the metadata or code of an existing function.

Path parameters
idstringRequired

The unique identifier of the function.

Body
descriptionstringOptional
codestringOptional
Responses
chevron-right
200

Function updated successfully.

application/json
idstringOptionalExample: function_abcde
namestringOptionalExample: analyzeMarket
descriptionstringOptionalExample: Analyzes market data and returns insights.
codestringOptionalExample: function analyzeMarket(data) { /* ... */ }
patch
/functions/{id}

Delete a function

delete

Remove a function by its unique identifier.

Path parameters
idstringRequired

The unique identifier of the function.

Responses
delete
/functions/{id}

No content

Invoke a function directly

post

Execute the specified function without linking it to an agent. Useful for quick testing or external usage.

Path parameters
idstringRequired

The unique identifier of the function.

Body
inputDataobjectOptional

Input needed for the function.

Responses
chevron-right
200

Function invoked successfully.

application/json
resultobjectOptional

Output of the executed function.

messagestringOptionalExample: Function executed successfully.
post
/functions/{id}/invoke

Last updated