Discover how to get detailed information about your prompt, including metadata, available versions, tags, and variable definitions.
Get prompt details
You can get detailed information about a prompt by providing its slug.
const { value } = await basalt.prompt.describe('my-prompt-slug')
Describe a specific Version
You can retrieve details about a specific version of a prompt by providing the version parameter.
// Using object syntax
const { value } = await basalt.prompt.describe({
slug: 'welcome-message',
version: '1.0.0'
})
// Using parameter syntax
const { value } = await basalt.prompt.describe('welcome-message', {
version: '1.0.0'
})
If both version and tag are provided, version takes precedence.
If neither is provided, the system attempts to find the production
tagged version
Describe a specific Tag
You can retrieve details about a specific tag of a prompt by providing the tag parameter.
// Using object syntax
const { value } = await basalt.prompt.describe({
slug: 'welcome-message',
tag: 'staging'
})
// Using parameter syntax
const { value } = await basalt.prompt.describe('welcome-message', {
tag: 'staging'
})
Returned data
When you describe a prompt, the SDK returns detailed information about the prompt, including its metadata, variables, and available versions and tags.
interface PromptDetailResponse {
slug?: string;
status: 'live' | 'draft';
name: string;
description?: string;
availableVersions: string[];
availableTags: string[];
variables: {
label: string;
description?: string;
type: string;
}[];
version: string;
tag?: string;
}
Example response
{
"slug": "welcome-message",
"status": "live",
"name": "Welcome Message",
"description": "A friendly welcome message for new users",
"availableVersions": ["1.0.0", "1.1.0", "2.0.0"],
"availableTags": ["production", "staging"],
"variables": [
{
"label": "name",
"description": "The user's full name",
"type": "string"
},
{
"label": "company",
"description": "The user's company name",
"type": "string"
}
],
"version": "2.0.0",
"tag": "production"
}
Error handling
Discover how to properly handle errors coming from the SDK and/or the API by checking the Error Handling documentation