Table of Contents

Prompt Variables

A prompt variable is a placeholder in a prompt that is replaced with a value when a completion request is built. Prompt variables let a single prompt adapt to the current date, the agent's tools, the files in the conversation, and the state of a multi-round workflow.

Overview

FoundationaLLM resolves prompt variables in two places:

Syntax Resolved by Where it applies
{{foundationallm:variable_name[:format]}} The Orchestration API, while it loads the agent's prompts. Workflow prompts (main, router, files, escalation, and final prompts), tool prompts, and the user prompt rewrite prompt.
{{variable_name}} (no prefix) The FoundationaLLM function-calling workflow in the LangChain API, while it runs. The workflow system prompt, the files prompt, and the escalation prompt.

FoundationaLLM Variables

FoundationaLLM variables use the following format:

{{foundationallm:variable_name[:format]}}

where:

  • foundationallm is a reserved keyword that marks the placeholder as a FoundationaLLM prompt variable.
  • variable_name is the name of the variable.
  • format is optional. It is supported only by current_datetime_utc.
Note

Prompt variables are resolved by a .NET component, so format is a .NET format string. For details, see Standard Date and Time Format Strings and Custom Date and Time Format Strings.

Variable Description
{{foundationallm:current_datetime_utc[:format]}} The current date and time in UTC. Without a format, the value uses the server's default date and time format, so specify a format when you need a predictable value. For example, the platform router prompts use {{foundationallm:current_datetime_utc:yyyy-MM-dd}}.
{{foundationallm:tool_list}} The list of the agent's tools, one line per tool in the form - {tool name}: {tool description}. Resolves to an empty string when the agent has no tools.
{{foundationallm:tool_router_prompts}} The router prompts of the agent's tools, each wrapped in **TOOL: {tool name} and **END OF TOOL: {tool name} markers. Resolves to an empty string when no tool has a router prompt.

The platform router prompts (Platform-Agent-Workflow-Router and Platform-Agent-Workflow-Router-Multi-Round) use tool_list and tool_router_prompts, so you rarely need to add these variables to your own main workflow prompt.

Variables are resolved repeatedly, so a variable inside an inserted value (for example, inside a tool router prompt) is also resolved. Unrecognized {{foundationallm:...}} placeholders are left unchanged.

Variables That Resolve to Empty Strings

The templating service also recognizes router_prompt, files_prompt, conversation_files, and attached_files with the foundationallm: prefix. The Orchestration API does not supply values for them when it builds agent prompts, so they resolve to empty strings.

Important

Older main workflow prompts may contain {{foundationallm:router_prompt}}. The FoundationaLLM function-calling workflow now adds the router prompt and the files prompt to the system prompt itself, so you can remove this variable. The router prompt is added only when a bound tool is listed in the Tools requiring the router prompt setting (see Agents and Workflows).

The user_message and previous_status_messages variables are used only by the platform realtime speech prompts.

Workflow Placeholders

The FoundationaLLM function-calling workflow replaces the following placeholders. They do not use the foundationallm: prefix.

Placeholder Where it is replaced Value
{{max_rounds}} Workflow system prompt (main, router, and files prompts), in multi-round mode only. The Max rounds value of the agent.
{{current_round}} Workflow system prompt, in multi-round mode only. The number of the current round, starting at 1.
{{conversation_files}} Files prompt. The files in the conversation, one line per file.
{{attached_files}} Files prompt. The files attached to the current message, one line per file.
{{context_files}} Files prompt. The files whose content is embedded directly in the request, one line per file.
{{available_tools}} Escalation prompt. A comma-separated list of the agent's tool names.
{{request_tools}} Escalation prompt. The name of the function that the model calls to request tools (request_tools).
Note

The workflow status messages configured on the Agent Workflows tab under Platform > Configuration use single braces: {current_round} and {max_rounds}.