curl --request PUT \
--url https://api.{domain}/v1/sessions/{session_id}/tools \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tools": [
{
"type": "function",
"name": "lookup_order",
"description": "Look up an order.",
"parameters": {
"type": "object",
"properties": {
"order_id": {
"type": "string"
}
},
"required": [
"order_id"
]
}
}
]
}
'import requests
url = "https://api.{domain}/v1/sessions/{session_id}/tools"
payload = { "tools": [
{
"type": "function",
"name": "lookup_order",
"description": "Look up an order.",
"parameters": {
"type": "object",
"properties": { "order_id": { "type": "string" } },
"required": ["order_id"]
}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tools: [
{
type: 'function',
name: 'lookup_order',
description: 'Look up an order.',
parameters: {
type: 'object',
properties: {order_id: {type: 'string'}},
required: ['order_id']
}
}
]
})
};
fetch('https://api.{domain}/v1/sessions/{session_id}/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.{domain}/v1/sessions/{session_id}/tools",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'tools' => [
[
'type' => 'function',
'name' => 'lookup_order',
'description' => 'Look up an order.',
'parameters' => [
'type' => 'object',
'properties' => [
'order_id' => [
'type' => 'string'
]
],
'required' => [
'order_id'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.{domain}/v1/sessions/{session_id}/tools"
payload := strings.NewReader("{\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"lookup_order\",\n \"description\": \"Look up an order.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"order_id\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"order_id\"\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.{domain}/v1/sessions/{session_id}/tools")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"lookup_order\",\n \"description\": \"Look up an order.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"order_id\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"order_id\"\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{domain}/v1/sessions/{session_id}/tools")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"lookup_order\",\n \"description\": \"Look up an order.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"order_id\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"order_id\"\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "session.tools",
"session_id": "<string>",
"tools": [
{
"type": "mcp",
"name": "<string>",
"url": "<string>",
"command": "<string>",
"args": [
"<string>"
],
"allowed_tools": [
"<string>"
],
"required": true,
"redacted": [
"<string>"
],
"description": "<string>",
"parameters": {},
"timeout_seconds": 123
}
],
"text": {
"verbosity": "low",
"format": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}Replace a session's tools
Replace a session’s tool configuration.
curl --request PUT \
--url https://api.{domain}/v1/sessions/{session_id}/tools \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tools": [
{
"type": "function",
"name": "lookup_order",
"description": "Look up an order.",
"parameters": {
"type": "object",
"properties": {
"order_id": {
"type": "string"
}
},
"required": [
"order_id"
]
}
}
]
}
'import requests
url = "https://api.{domain}/v1/sessions/{session_id}/tools"
payload = { "tools": [
{
"type": "function",
"name": "lookup_order",
"description": "Look up an order.",
"parameters": {
"type": "object",
"properties": { "order_id": { "type": "string" } },
"required": ["order_id"]
}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tools: [
{
type: 'function',
name: 'lookup_order',
description: 'Look up an order.',
parameters: {
type: 'object',
properties: {order_id: {type: 'string'}},
required: ['order_id']
}
}
]
})
};
fetch('https://api.{domain}/v1/sessions/{session_id}/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.{domain}/v1/sessions/{session_id}/tools",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'tools' => [
[
'type' => 'function',
'name' => 'lookup_order',
'description' => 'Look up an order.',
'parameters' => [
'type' => 'object',
'properties' => [
'order_id' => [
'type' => 'string'
]
],
'required' => [
'order_id'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.{domain}/v1/sessions/{session_id}/tools"
payload := strings.NewReader("{\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"lookup_order\",\n \"description\": \"Look up an order.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"order_id\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"order_id\"\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.{domain}/v1/sessions/{session_id}/tools")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"lookup_order\",\n \"description\": \"Look up an order.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"order_id\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"order_id\"\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{domain}/v1/sessions/{session_id}/tools")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"lookup_order\",\n \"description\": \"Look up an order.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"order_id\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"order_id\"\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "session.tools",
"session_id": "<string>",
"tools": [
{
"type": "mcp",
"name": "<string>",
"url": "<string>",
"command": "<string>",
"args": [
"<string>"
],
"allowed_tools": [
"<string>"
],
"required": true,
"redacted": [
"<string>"
],
"description": "<string>",
"parameters": {},
"timeout_seconds": 123
}
],
"text": {
"verbosity": "low",
"format": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>"
}
}Authorizations
A gbr_pat_ access token. Scopes are recorded on the token when it is minted.
Headers
Retrying with the same key replays the first answer instead of acting again.
255Body
What the agent may call. Replaces the session's whole configuration — entries are not merged with what is already there.
What the agent may reach outside the workspace: your own functions, MCP servers, and which built-ins. Everything inside the workspace — shell, files, git — is always there and is not configured here. An empty array leaves the session with no route to the network at all.
Show child attributes
Show child attributes
Shaping the final message: how much it says, and whether it must conform to a JSON Schema.
Show child attributes
Show child attributes
Response
Replace a session's tool configuration.
Always session.tools. Names the shape, so a value can be identified without knowing which call returned it.
"session.tools"The session this configuration applies to.
The configuration as sent, in the same vocabulary: one entry per tool, each with a type of mcp or function. Secret values are withheld — see redacted.
Show child attributes
Show child attributes
Output shaping, or null when none was set. Asked of the model, not enforced.
Show child attributes
Show child attributes