think_about_whether_you_are_done
Check if you have completed the user's request by calling this tool to confirm task fulfillment before proceeding.
Instructions
Whenever you feel that you are done with what the user has asked for, it is important to call this tool.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/serena/tools/workflow_tools.py:86-96 (handler)The handler implementation: subclass of Tool with apply() method that returns a generated prompt instructing the agent to think about task completion.class ThinkAboutWhetherYouAreDoneTool(Tool): """ Thinking tool for determining whether the task is truly completed. """ def apply(self) -> str: """ Whenever you feel that you are done with what the user has asked for, it is important to call this tool. """ return self.prompt_factory.create_think_about_whether_you_are_done()
- src/serena/tools/tools_base.py:355-367 (registration)ToolRegistry singleton automatically discovers and registers all Tool subclasses (including ThinkAboutWhetherYouAreDoneTool) from serena.tools modules by deriving tool names via get_name_from_cls().@singleton class ToolRegistry: def __init__(self) -> None: self._tool_dict: dict[str, RegisteredTool] = {} for cls in iter_subclasses(Tool): if not any(cls.__module__.startswith(pkg) for pkg in tool_packages): continue is_optional = issubclass(cls, ToolMarkerOptional) name = cls.get_name_from_cls() if name in self._tool_dict: raise ValueError(f"Duplicate tool name found: {name}. Tool classes must have unique names.") self._tool_dict[name] = RegisteredTool(tool_class=cls, is_optional=is_optional, tool_name=name)
- Generated helper method in PromptFactory that renders the prompt template used by the tool's apply() method.def create_think_about_whether_you_are_done(self) -> str: return self._render_prompt("think_about_whether_you_are_done", locals())
- Class method that derives the tool name 'think_about_whether_you_are_done' from the class name ThinkAboutWhetherYouAreDoneTool, used during registration.def get_name_from_cls(cls) -> str: name = cls.__name__ if name.endswith("Tool"): name = name[:-4] # convert to snake_case name = "".join(["_" + c.lower() if c.isupper() else c for c in name]).lstrip("_") return name