Skip to main content

build_system_prompt_content

function build_system_prompt_content

Builds the final system prompt string using a template, tool descriptions, and optional additional instructions.
Parameters
str
required
The system prompt template string (must contain '').
list[str]
required
A list of formatted tool description strings.
str | None
default:"None"
Optional extra instructions to append.
Returns
str
The fully formatted system prompt content string.
Signature

create_system_message

function create_system_message

Creates the final SystemMessage object for the agent.Handles selecting the correct template, generating tool descriptions, and incorporating user overrides and additional instructions.
Parameters
list[langchain_core.tools.base.BaseTool]
required
List of available tools.
str
required
The default system prompt template.
str
required
The template to use when server manager is active.
bool
required
Flag indicating if server manager mode is enabled.
list[str] | None
default:"None"
List of tool names to exclude.
str | None
default:"None"
A complete system prompt provided by the user, overriding templates.
str | None
default:"None"
Extra instructions to append to the template-based prompt.
Returns
langchain_core.messages.system.SystemMessage
A SystemMessage object containing the final prompt content.
Signature

generate_tool_descriptions

function generate_tool_descriptions

Generates a list of formatted tool descriptions, excluding disallowed tools.
Parameters
list[langchain_core.tools.base.BaseTool]
required
The list of available BaseTool objects.
list[str] | None
default:"None"
A list of tool names to exclude.
Returns
list[str]
A list of strings, each describing a tool in the format ”- tool_name: description”.
Signature