curl --request POST \
--url https://app.codealive.ai/api/tools/get_file_tree \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data_source": "<string>",
"path": "<string>",
"max_depth": 123,
"max_nodes": 123,
"output_depth": 123
}
'import requests
url = "https://app.codealive.ai/api/tools/get_file_tree"
payload = {
"data_source": "<string>",
"path": "<string>",
"max_depth": 123,
"max_nodes": 123,
"output_depth": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data_source: '<string>',
path: '<string>',
max_depth: 123,
max_nodes: 123,
output_depth: 123
})
};
fetch('https://app.codealive.ai/api/tools/get_file_tree', 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://app.codealive.ai/api/tools/get_file_tree",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data_source' => '<string>',
'path' => '<string>',
'max_depth' => 123,
'max_nodes' => 123,
'output_depth' => 123
]),
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://app.codealive.ai/api/tools/get_file_tree"
payload := strings.NewReader("{\n \"data_source\": \"<string>\",\n \"path\": \"<string>\",\n \"max_depth\": 123,\n \"max_nodes\": 123,\n \"output_depth\": 123\n}")
req, _ := http.NewRequest("POST", 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.post("https://app.codealive.ai/api/tools/get_file_tree")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data_source\": \"<string>\",\n \"path\": \"<string>\",\n \"max_depth\": 123,\n \"max_nodes\": 123,\n \"output_depth\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.codealive.ai/api/tools/get_file_tree")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data_source\": \"<string>\",\n \"path\": \"<string>\",\n \"max_depth\": 123,\n \"max_nodes\": 123,\n \"output_depth\": 123\n}"
response = http.request(request)
puts response.read_body{
"obj": {
"hint": "<string>",
"trees": [
{
"dataSource": {
"type": "<string>",
"name": "<string>"
},
"fullName": "<string>",
"path": "<string>",
"found": true,
"tree": "<string>"
}
],
"error": {
"tool": "<string>",
"detail": "<string>",
"retry": "<string>",
"hint": "<string>"
},
"warnings": [
{
"code": "<string>",
"message": "<string>",
"alias": "<string>",
"canonical": "<string>"
}
]
},
"rendered": "<string>"
}Get repository file tree
Returns a bounded directory tree for one repository, with short generated summaries for files and folders. Use it for structural orientation when you need to see how a repository (or one directory) is laid out; bound the response with max_depth and max_nodes. For concept questions prefer semantic_search — a folder whose name matches a concept is one candidate, not the whole story.
curl --request POST \
--url https://app.codealive.ai/api/tools/get_file_tree \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data_source": "<string>",
"path": "<string>",
"max_depth": 123,
"max_nodes": 123,
"output_depth": 123
}
'import requests
url = "https://app.codealive.ai/api/tools/get_file_tree"
payload = {
"data_source": "<string>",
"path": "<string>",
"max_depth": 123,
"max_nodes": 123,
"output_depth": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data_source: '<string>',
path: '<string>',
max_depth: 123,
max_nodes: 123,
output_depth: 123
})
};
fetch('https://app.codealive.ai/api/tools/get_file_tree', 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://app.codealive.ai/api/tools/get_file_tree",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data_source' => '<string>',
'path' => '<string>',
'max_depth' => 123,
'max_nodes' => 123,
'output_depth' => 123
]),
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://app.codealive.ai/api/tools/get_file_tree"
payload := strings.NewReader("{\n \"data_source\": \"<string>\",\n \"path\": \"<string>\",\n \"max_depth\": 123,\n \"max_nodes\": 123,\n \"output_depth\": 123\n}")
req, _ := http.NewRequest("POST", 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.post("https://app.codealive.ai/api/tools/get_file_tree")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data_source\": \"<string>\",\n \"path\": \"<string>\",\n \"max_depth\": 123,\n \"max_nodes\": 123,\n \"output_depth\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.codealive.ai/api/tools/get_file_tree")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data_source\": \"<string>\",\n \"path\": \"<string>\",\n \"max_depth\": 123,\n \"max_nodes\": 123,\n \"output_depth\": 123\n}"
response = http.request(request)
puts response.read_body{
"obj": {
"hint": "<string>",
"trees": [
{
"dataSource": {
"type": "<string>",
"name": "<string>"
},
"fullName": "<string>",
"path": "<string>",
"found": true,
"tree": "<string>"
}
],
"error": {
"tool": "<string>",
"detail": "<string>",
"retry": "<string>",
"hint": "<string>"
},
"warnings": [
{
"code": "<string>",
"message": "<string>",
"alias": "<string>",
"canonical": "<string>"
}
]
},
"rendered": "<string>"
}Authorizations
API Key authentication using Bearer token. Example: "Authorization: Bearer {apiKey}"
Body
Optional success projection. Omit to return both obj and rendered; use json for obj only; use agentic for rendered text only. Repairable errors always return both obj.error and rendered.
json, agentic One repository name or id returned by get_data_sources. Required when more than one repository is visible.
Optional repository-relative directory path. Omit for repository root.
Optional traversal depth limit.
Optional maximum number of tree nodes to return.
Optional rendered output depth limit.
Response
Success envelope. obj contains trees[] (one per resolved repository) with a rendered tree string and a hint; rendered is the JSON-serialized form of obj. Repairable failures (missing or invalid arguments, ambiguous or unknown data sources) also return HTTP 200 with obj.error = { code, message, retry, try } and a rendered <tool_error> block; repair the arguments and retry.
Was this page helpful?