Create Tool
curl --request POST \
--url https://api.example.com/toolsimport requests
url = "https://api.example.com/tools"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/tools', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/tools",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/tools"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/tools")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/tools")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyTools
Create Tool
Creates a new tool in the environment.
POST
/
tools
Create Tool
curl --request POST \
--url https://api.example.com/toolsimport requests
url = "https://api.example.com/tools"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/tools', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/tools",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/tools"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/tools")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/tools")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyEndpoint
POST https://gateway.orkeia.ai/tools
AuthenticationRequires header
authorization: <your_token>.
Request Body (JSON)
The service expects a wrapper with the propertytool. (Theenvironmentis handled on the server.)
Note: the fieldtypedoes not exist in this interface. Use the fields defined inTool(below).
{
"tool": {
"name": "My Tool",
"description": "Tool description",
"code": "export async function run(input){ return { ok: true }; }",
"entryFunctionName": "run",
"sectors": ["engineering", "legal"],
"publisher": "Orkeia",
"enabled": true,
"environments": ["prod"],
"mcp": {
"url": "https://tools.orkeia.ai/my-tool",
"transport": "sse"
}
}
}
Example (cURL)
curl -X POST "https://gateway.orkeia.ai/tools" -H "authorization: <your_token>" -H "Content-Type: application/json" -d '{
"tool": {
"name": "My Tool",
"description": "Tool description",
"code": "export async function run(input){ return { ok: true }; }",
"entryFunctionName": "run",
"sectors": ["engineering", "legal"],
"publisher": "Orkeia",
"enabled": true,
"environments": ["prod"],
"mcp": {
"url": "https://tools.orkeia.ai/my-tool",
"transport": "sse"
}
}
}'
Responses
Response - Success
response
{
"status": "OK",
"data": { "id": "TOOL_123456" }
}
500 — Server Error
{
"status": "ERROR",
"code": "server/error",
"data": null
}
400 — Client Error
{
"status": "ERROR",
"code": "client/error",
"data": null
}
Reference Interface (Tool)
export interface Tool {
id?: string;
name: string;
description: string;
code?: string;
entryFunctionName?: string;
sectors: string[];
publisher: string;
enabled: boolean;
environments: string[];
mcp?: {
url: string;
transport: 'sse' | 'streamable-http';
};
}
Fields
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
| id | string | No | Unique identifier (returned by the backend). | TOOL_123456 |
| name | string | Yes | Name of the tool. | My Tool |
| description | string | Yes | Short description of the functionality. | Performs integration operations |
| code | string | No | Executable source code of the tool (when applicable). | export async function run(){...} |
| entryFunctionName | string | No | Name of the exported function in code that will be invoked. | run |
| sectors | string[] | Yes | Authorized sectors to use the tool. | ["engineering","legal"] |
| publisher | string | Yes | Publisher/organization responsible. | Orkeia |
| enabled | boolean | Yes | Indicates if the tool is enabled. | true |
| environments | string[] | Yes | Environments in which the tool is available. | ["prod","staging"] |
| mcp | object | No | Configuration for use via Model Context Protocol (MCP). | { "url": "...", "transport": "sse" } |
| mcp.url | string | No | URL of the MCP server. | https://tools.orkeia.ai/my-tool |
| mcp.transport | 'sse' | 'streamable-http' | No | Supported MCP transport type. | sse |
Was this page helpful?
⌘I
