Skip to main content

Prompts

Prompts

@toothfairyai/sdk@latest…

Prompt Management Module Handles prompt CRUD operations for AI agent prompts.

Accessed via client.prompts.

Methods

MethodHTTPEndpoint
createPOSTPOST /prompt/create
getGETGET /prompt/get/{id}
updatePOSTPOST /prompt/update
deleteDELETEDELETE /prompt/delete/{id}
listGETGET /prompt/list
getByTypederived
getByAgentderived
getByScopederived
searchderived
clonederived

create

Create a new prompt interpolationString is at least 128 characters.

async create(
label: string,
interpolationString: string,
options: {
scope?: string;
style?: string;
domain?: string;
promptPlaceholder?: string;
availableToAgents?: string[];
} = {}
)

Endpoint: POST /prompt/create · API service

Request fields

FieldTypeRequiredDescription
idstringnoUnique identifier for the prompt
workspaceidstringyesYour workspace ID (UUID v4). Auto-injected by the SDK client from your configuration; you do not need to set it manually.
typestringnoPrompt type classification
scopestringnoOAuth scope
stylestringnoGeneration style: default, short, long, funny, informal, formal, interview, academic, business, creative, scientific, poetry, or news
domainstringnoGeneration domain: editorial, customerService, sales, marketing, hr, finance, legal, medical, science, technology, or default
labelstringyesHuman-readable display name
promptLengthintegeryesLength of the prompt in characters (32-2048)
promptPlaceholderstringnoPrompt placeholder text
interpolationStringstringyesPrompt interpolation string
availableToAgentsstringnoList of agent IDs this prompt is available to
createdBystringnoUser ID who created the prompt
updatedBystringnoUser ID who last updated the prompt

Response fields

FieldTypeDescription
idstringUnique identifier for the prompt
typestringPrompt type classification
scopestringOAuth scope
stylestringGeneration style: default, short, long, funny, informal, formal, interview, academic, business, creative, scientific, poetry, or news
domainstringGeneration domain: editorial, customerService, sales, marketing, hr, finance, legal, medical, science, technology, or default
labelstringHuman-readable display name
promptLengthnumberLength of the prompt in characters (32-2048)
promptPlaceholderstringPrompt placeholder text
interpolationStringstringPrompt interpolation string
availableToAgentsarray<string>List of agent IDs this prompt is available to
workspaceIDstringUnique workspace identifier (UUID v4)
createdBystringUser ID who created the prompt
updatedBystringUser ID who last updated the prompt
createdAtstringTimestamp when this resource was created
updatedAtstringTimestamp when this resource was last updated

Example

const result = await client.prompts.create('…', '…');

get

Get a prompt by ID

async get(promptId: string)

Endpoint: GET /prompt/get/{id} · API service

Response

Returns the Prompt object — fields documented in the create section above.

Example

const result = await client.prompts.get('agent-id');

update

Update an existing prompt

async update(
promptId: string,
options: {
label?: string;
interpolationString?: string;
scope?: string;
style?: string;
domain?: string;
promptPlaceholder?: string;
availableToAgents?: string[];
} = {}
)

Endpoint: POST /prompt/update · API service

Request fields

FieldTypeRequiredDescription
idstringyesUnique identifier for the prompt
workspaceidstringnoYour workspace ID (UUID v4). Auto-injected by the SDK client from your configuration; you do not need to set it manually.
typestringnoPrompt type classification
scopestringnoOAuth scope
stylestringnoGeneration style: default, short, long, funny, informal, formal, interview, academic, business, creative, scientific, poetry, or news
domainstringnoGeneration domain: editorial, customerService, sales, marketing, hr, finance, legal, medical, science, technology, or default
labelstringnoHuman-readable display name
promptLengthintegernoLength of the prompt in characters (32-2048)
promptPlaceholderstringnoPrompt placeholder text
interpolationStringstringnoPrompt interpolation string
availableToAgentsstringnoList of agent IDs this prompt is available to
createdBystringnoUser ID who created the prompt
updatedBystringnoUser ID who last updated the prompt

Response

Returns the Prompt object — fields documented in the create section above.

Example

const result = await client.prompts.update('agent-id');

delete

Delete a prompt

async delete(promptId: string): Promise<

Endpoint: DELETE /prompt/delete/{id} · API service

Response fields

FieldTypeDescription
successbooleanOperation success status
dataobjectResponse data
messagestringOptional success message

Example

const result = await client.prompts.delete('agent-id');

list

List prompts in the workspace

async list(promptType?: string, limit?: number, offset?: number)

Endpoint: GET /prompt/list · API service

Example

const result = await client.prompts.list();

getByType

Get prompts by type

async getByType(promptType: string, limit?: number)

Derived method — delegates to another SDK call and performs no direct HTTP request.

Example

const result = await client.prompts.getByType('…');

getByAgent

Get prompts available to a specific agent

async getByAgent(agentId: string)

Derived method — delegates to another SDK call and performs no direct HTTP request.

Example

const result = await client.prompts.getByAgent('agent-id');

getByScope

Get prompts by scope

async getByScope(scope: string)

Derived method — delegates to another SDK call and performs no direct HTTP request.

Example

const result = await client.prompts.getByScope('…');

Search prompts by label or content

async search(searchTerm: string, promptType?: string)

Derived method — delegates to another SDK call and performs no direct HTTP request.

Example

const result = await client.prompts.search('…');

clone

Clone an existing prompt with modifications

async clone(
promptId: string,
options: {
label?: string;
interpolationString?: string;
scope?: string;
style?: string;
domain?: string;
promptPlaceholder?: string;
availableToAgents?: string[];
} = {}
)

Derived method — delegates to another SDK call and performs no direct HTTP request.

Example

const result = await client.prompts.clone('agent-id');