Criar Ferramenta
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_bodyFerramentas
Criar Ferramenta
Cria uma nova ferramenta no ambiente.
POST
/
tools
Criar Ferramenta
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
AutenticaçãoRequer cabeçalho
authorization: <seu_token>.
Corpo da Requisição (JSON)
O serviço espera um wrapper com a propriedadetool. (Oenvironmenté tratado no servidor.)
Atenção: o campotypenão existe nesta interface. Utilize os campos definidos emTool(abaixo).
{
"tool": {
"name": "Minha Ferramenta",
"description": "Descrição da ferramenta",
"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"
}
}
}
Exemplo (cURL)
curl -X POST "https://gateway.orkeia.ai/tools" -H "authorization: <seu_token>" -H "Content-Type: application/json" -d '{
"tool": {
"name": "Minha Ferramenta",
"description": "Descrição da ferramenta",
"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"
}
}
}'
Respostas
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
}
Interface de Referência (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';
};
}
Campos
| Nome | Tipo | Obrigatório | Descrição | Exemplo |
|---|---|---|---|---|
| id | string | Não | Identificador único (retornado pelo backend). | TOOL_123456 |
| name | string | Sim | Nome da ferramenta. | Minha Ferramenta |
| description | string | Sim | Descrição curta sobre a funcionalidade. | Executa operações de integração |
| code | string | Não | Código fonte executável da ferramenta (quando aplicável). | export async function run(){...} |
| entryFunctionName | string | Não | Nome da função exportada no code que será invocada. | run |
| sectors | string[] | Sim | Setores autorizados a utilizar a ferramenta. | ["engineering","legal"] |
| publisher | string | Sim | Publicador/organização responsável. | Orkeia |
| enabled | boolean | Sim | Indica se a ferramenta está habilitada. | true |
| environments | string[] | Sim | Ambientes em que a ferramenta está disponível. | ["prod","staging"] |
| mcp | objeto | Não | Configuração para uso via Model Context Protocol (MCP). | { "url": "...", "transport": "sse" } |
| mcp.url | string | Não | URL do servidor MCP. | https://tools.orkeia.ai/my-tool |
| mcp.transport | 'sse' | 'streamable-http' | Não | Tipo de transporte MCP suportado. | sse |
Esta página foi útil?
⌘I
