Skip to main content

What Are Prompts?

Prompts define:
  • system instructions (prompt)
  • model (model)
  • available tools (tools)
  • optional context controls and validation
Prompts are auto-discovered from agents/prompts/.

Basic Example

import { definePrompt } from '@standardagents/builder';

export default definePrompt({
  name: 'orchestrator_prompt',
  toolDescription: 'Orchestrates specialized work.',
  prompt: 'Delegate tasks to the right tools and summarize outcomes.',
  model: 'base_model',
  includeChat: true,
  tools: ['search_docs'],
});

Tool Types in tools

tools accepts multiple forms:
  • string callable name
  • SubpromptConfig for prompt-tool options
  • PromptToolConfig for tool-level options
  • SubagentToolConfig for dual_ai subagent relationships

Subagent Tool Configuration

Use SubagentToolConfig to define parent -> child behavior:
tools: [
  {
    name: 'topdown_asset_subagent',
    blocking: false,
    initUserMessageProperty: 'message',
    initAttachmentsProperty: 'attachments',
    initAgentNameProperty: 'name',
    resumable: {
      receives_messages: 'side_a',
      maxInstances: 20,
    },
  },
],

Important Fields

  • blocking: wait for child completion or return immediately
  • resumable: persistent child instances with message routing
  • initUserMessageProperty: map args to child initial message
  • initAttachmentsProperty: map args to child initial attachment paths
  • initAgentNameProperty: map args to child thread display name

Resumable Runtime Tools

When a prompt has resumable subagent configs, AgentBuilder injects runtime tools:
  • subagent_create
  • subagent_message
Non-resumable subagents behave like normal tool calls and are not created via lifecycle tools.

Context and Validation

Useful options:
  • includeChat
  • includePastTools
  • toolChoice
  • requiredSchema
  • reasoning
  • hooks

Best Practices

  • Keep orchestrator prompts focused on delegation + synthesis
  • Put strict production/QA logic into the child dual_ai agent
  • Use explicit init*Property mappings for predictable payloads
  • Set reasonable maxInstances on resumable children