JavaScript
import PromptFoundry from '@prompt-foundry/typescript-sdk';
const client = new PromptFoundry({
apiKey: process.env['PROMPT_FOUNDRY_API_KEY'], // This is the default and can be omitted
});
async function main() {
const tool = await client.tools.get('1212121');
console.log(tool.id);
}
main();import os
from prompt_foundry_python_sdk import PromptFoundry
client = PromptFoundry(
# This is the default and can be omitted
api_key=os.environ.get("PROMPT_FOUNDRY_API_KEY"),
)
tool = client.tools.get(
"1212121",
)
print(tool.id)curl --request GET \
--url https://api.promptfoundry.ai/sdk/v1/tools/{id} \
--header 'X-API-KEY: <api-key>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.promptfoundry.ai/sdk/v1/tools/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$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.promptfoundry.ai/sdk/v1/tools/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.promptfoundry.ai/sdk/v1/tools/{id}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.promptfoundry.ai/sdk/v1/tools/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"parameters": {}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}API Reference
Get Tool
Fetch the details of a specific tool using its ID.
GET
/
sdk
/
v1
/
tools
/
{id}
JavaScript
import PromptFoundry from '@prompt-foundry/typescript-sdk';
const client = new PromptFoundry({
apiKey: process.env['PROMPT_FOUNDRY_API_KEY'], // This is the default and can be omitted
});
async function main() {
const tool = await client.tools.get('1212121');
console.log(tool.id);
}
main();import os
from prompt_foundry_python_sdk import PromptFoundry
client = PromptFoundry(
# This is the default and can be omitted
api_key=os.environ.get("PROMPT_FOUNDRY_API_KEY"),
)
tool = client.tools.get(
"1212121",
)
print(tool.id)curl --request GET \
--url https://api.promptfoundry.ai/sdk/v1/tools/{id} \
--header 'X-API-KEY: <api-key>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.promptfoundry.ai/sdk/v1/tools/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$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.promptfoundry.ai/sdk/v1/tools/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.promptfoundry.ai/sdk/v1/tools/{id}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.promptfoundry.ai/sdk/v1/tools/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"parameters": {}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Path Parameters
Example:
"1212121"
Response
Successfully retrieved the tool configuration
The initial messages to be included with your call to the LLM API.
The name of the tool to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
Pattern:
^[a-zA-Z0-9_-]{1,64}$A description of what the tool does, used by the model to choose when and how to call the tool.
The parameters the functions accepts, described as a JSON Schema object. This schema is designed to match the TypeScript Record<string, unknown>, allowing for any properties with values of any type.
Show child attributes
Show child attributes
Was this page helpful?