Get ArtifactQuery schema
curl --request POST \
--url https://app.codealive.ai/api/tools/get_artifact_query_schema \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entity": "files",
"include_examples": true
}
'import requests
url = "https://app.codealive.ai/api/tools/get_artifact_query_schema"
payload = {
"entity": "files",
"include_examples": True
}
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({entity: 'files', include_examples: true})
};
fetch('https://app.codealive.ai/api/tools/get_artifact_query_schema', 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_artifact_query_schema",
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([
'entity' => 'files',
'include_examples' => true
]),
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_artifact_query_schema"
payload := strings.NewReader("{\n \"entity\": \"files\",\n \"include_examples\": true\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_artifact_query_schema")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity\": \"files\",\n \"include_examples\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.codealive.ai/api/tools/get_artifact_query_schema")
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 \"entity\": \"files\",\n \"include_examples\": true\n}"
response = http.request(request)
puts response.read_body{
"obj": {
"dsl_version": "artifactquery/v1",
"entity": "files",
"entities": [
"files",
"symbols",
"functions"
],
"fields": [
"path",
"language",
"lines",
"complexity"
],
"relationships": [
"outgoing_calls",
"incoming_calls",
"references"
],
"operators": [
"=",
"!=",
">",
">=",
"<",
"<=",
"IN"
],
"required_limit": true,
"examples": [
"SELECT path, language, lines FROM files LIMIT 20",
"SELECT count() AS count, language FROM files GROUP BY language LIMIT 20"
]
},
"rendered": "{\"dsl_version\":\"artifactquery/v1\",\"entities\":[\"files\",\"symbols\",\"functions\"],\"required_limit\":true,\"examples\":[\"SELECT path, language, lines FROM files LIMIT 20\"]}"
}ToolApi
Get ArtifactQuery schema
Returns the ArtifactQuery v1 catalog: queryable entities, fields, operators, relationships, limits, and example statements. Call it before composing a non-trivial query_artifact_metadata statement, or after a validation error, to get exact field names and supported operators.
POST
/
api
/
tools
/
get_artifact_query_schema
Get ArtifactQuery schema
curl --request POST \
--url https://app.codealive.ai/api/tools/get_artifact_query_schema \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entity": "files",
"include_examples": true
}
'import requests
url = "https://app.codealive.ai/api/tools/get_artifact_query_schema"
payload = {
"entity": "files",
"include_examples": True
}
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({entity: 'files', include_examples: true})
};
fetch('https://app.codealive.ai/api/tools/get_artifact_query_schema', 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_artifact_query_schema",
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([
'entity' => 'files',
'include_examples' => true
]),
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_artifact_query_schema"
payload := strings.NewReader("{\n \"entity\": \"files\",\n \"include_examples\": true\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_artifact_query_schema")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity\": \"files\",\n \"include_examples\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.codealive.ai/api/tools/get_artifact_query_schema")
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 \"entity\": \"files\",\n \"include_examples\": true\n}"
response = http.request(request)
puts response.read_body{
"obj": {
"dsl_version": "artifactquery/v1",
"entity": "files",
"entities": [
"files",
"symbols",
"functions"
],
"fields": [
"path",
"language",
"lines",
"complexity"
],
"relationships": [
"outgoing_calls",
"incoming_calls",
"references"
],
"operators": [
"=",
"!=",
">",
">=",
"<",
"<=",
"IN"
],
"required_limit": true,
"examples": [
"SELECT path, language, lines FROM files LIMIT 20",
"SELECT count() AS count, language FROM files GROUP BY language LIMIT 20"
]
},
"rendered": "{\"dsl_version\":\"artifactquery/v1\",\"entities\":[\"files\",\"symbols\",\"functions\"],\"required_limit\":true,\"examples\":[\"SELECT path, language, lines FROM files LIMIT 20\"]}"
}Authorizations
Body
application/jsontext/jsonapplication/*+json
Response
Success envelope. obj is the ArtifactQuery catalog: dsl_version, entities, fields, relationships, operators, required_limit, and examples; 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?