View the source code for this module on GitHub: https://github.com/mcp-use/mcp-use/blob/main/mcp_use/agents/prompts/system_prompt_builder.py
build_system_prompt_content
function
build_system_prompt_content
Builds the final system prompt string using a template, tool descriptions,
and optional additional instructions.ReturnsThe system prompt template string (must contain '').A list of formatted tool description strings.Optional extra instructions to append.
SignatureThe fully formatted system prompt content string.
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.ReturnsList of available tools.The default system prompt template.The template to use when server manager is active.Flag indicating if server manager mode is enabled.List of tool names to exclude.A complete system prompt provided by the user, overriding templates.Extra instructions to append to the template-based prompt.
SignatureA SystemMessage object containing the final prompt content.
generate_tool_descriptions
function
generate_tool_descriptions
Generates a list of formatted tool descriptions, excluding disallowed tools.ReturnsThe list of available BaseTool objects.A list of tool names to exclude.
SignatureA list of strings, each describing a tool in the format ”- tool_name: description”.