diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 8e4d900dc..8c7f16490 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -1161,8 +1161,6 @@ class Coder: def fmt_system_prompt(self, prompt): final_reminders = [] - if self.mcp_tools and len(self.mcp_tools) > 0: - final_reminders.append(self.gpt_prompts.tool_prompt) if self.main_model.lazy: final_reminders.append(self.gpt_prompts.lazy_prompt) @@ -1198,6 +1196,9 @@ class Coder: else: quad_backtick_reminder = "" + if self.mcp_tools and len(self.mcp_tools) > 0: + final_reminders.append(self.gpt_prompts.tool_prompt) + final_reminders = "\n\n".join(final_reminders) prompt = prompt.format( diff --git a/aider/coders/base_prompts.py b/aider/coders/base_prompts.py index e7fb79d3f..cd93b9ef8 100644 --- a/aider/coders/base_prompts.py +++ b/aider/coders/base_prompts.py @@ -56,13 +56,17 @@ Do not edit these files! no_shell_cmd_prompt = "" no_shell_cmd_reminder = "" - tool_prompt = """ALWAYS Answer the user's request using the relevant tool(s), if they are -available. -Do your best to infer required parameters from your context. If the user provides a -specific value for a parameter (for example provided in quotes), make sure to use that -value EXACTLY. -Carefully analyze descriptive terms in the request as they may indicate required parameter values -that should be included even if not explicitly quoted. + tool_prompt = """ + +When solving problems, you have special tools available. Please follow these rules: + +1. Always use the exact format required for each tool and include all needed information. +2. Only use tools that are currently available in this conversation. +3. Don't mention tool names when talking to people. Say "I'll check your code" instead + of "I'll use the code_analyzer tool." +4. Only use tools when necessary. If you know the answer, just respond directly. +5. Before using any tool, briefly explain why you need to use it. + """ rename_with_shell = ""