Skip to content

Prompts ​

Read, and when you must change, the prompts the SDK sends to the model.

The SDK puts a few prompts of its own in front of the model:

  • the reasoning directive,
  • the refusals the executor sends back when a tool call is wrong,
  • the headers of worker replies,
  • the manuals of the subagents and scheduled_actions tools, and a few more.

They live as plain .md files in src/prompts/, and DEFAULT_PROMPTS holds their text, so you can read exactly what the model sees. AgentConfig.prompts replaces single ones for one agent.

Keeping the original prompt is recommended. The shipped text is what the SDK is tested with. Treat it as the reference: copy a prompt, change what you must, and keep the parts that tell the model how to use a tool or recover from an error.

ts
import { Agent, DEFAULT_PROMPTS } from "agent-accelerator";

console.log(DEFAULT_PROMPTS.toolSchemaError); // read the original

const agent = new Agent({
  model: "google/gemini-3.5-flash-lite",
  prompts: {
    toolNotFound:
      "Unknown tool '{{tool}}'.{{suggestion}} Use only the tools you were given.",
  },
});

Every prompt you leave out keeps its default. An unknown name or an empty text throws a ConfigError when the agent is built. Workers (the subagents tool, agent.workers, scheduled actions) inherit the overrides.

The prompts ​

marks a value the SDK fills in. A marker you leave out of your text is simply not filled; a marker the SDK does not know stays as written.

NameWhere the model sees itPlaceholders
reasoningDirectiveEnd of the system prompt, when thinking is onnone
structuredOutputSystem prompt, only for a model without native JSON output (after a [Structured Output] line)
additionalContextStart of a user turn that has additionalContext (then a blank line)
toolBridgeA short assistant turn between a tool result and the next user message, on OpenRouter and compatible endpointsnone
toolTruncatedArgumentsResult of a call whose streamed arguments never parsed
toolNotFoundResult of a call to an unknown tool, (" Did you mean 'x'?" or empty)
toolSchemaErrorResult of a call whose arguments fail the tool's schema, , ,
toolRepeatBlockedResult of the 3rd identical call in a row (the result also carries errorCode: "repeat_blocked")
toolInterruptedResult placed behind a call a crash or interrupt left without one,
workerReplied, workerFailedThe header of a subagents spawn/message answer, /
subagentsToolThe subagents tool description,
scheduledActionsToolThe scheduled_actions tool description

Caching ​

reasoningDirective, structuredOutput and the two tool manuals are part of the cached prompt prefix. Set them once in the config, not per run, so the prefix stays stable.

Released under the MIT License.