think_about_whether_you_are_done
Call this tool to confirm task completion when you believe user requirements are fully addressed. Ensures clarity and finality in task execution.
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 whose apply() method renders and returns a prompt for the agent to evaluate 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:360-370 (registration)Automatic registration of all Tool subclasses (including ThinkAboutWhetherYouAreDoneTool) in serena.tools modules via ToolRegistry singleton, deriving name 'think_about_whether_you_are_done'.def __init__(self) -> None: self._tool_dict: dict[str, RegisteredTool] = {} for cls in iter_subclasses(Tool): if not cls.__module__.startswith("serena.tools"): 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)
- Helper method in generated prompt factory that renders the prompt template used by the tool handler.def create_think_about_whether_you_are_done(self) -> str: return self._render_prompt("think_about_whether_you_are_done", locals())
- src/serena/agent.py:214-215 (registration)SerenaAgent instantiates all registered tools (including this one) during initialization.self._all_tools: dict[type[Tool], Tool] = {tool_class: tool_class(self) for tool_class in ToolRegistry().get_all_tool_classes()} tool_names = [tool.get_name_from_cls() for tool in self._all_tools.values()]
- Generates schema/metadata from the apply() method's signature and docstring for MCP tool definition.def get_apply_fn_metadata_from_cls(cls) -> FuncMetadata: """Get the metadata for the apply method from the class (static metadata). Needed for creating MCP tools in a separate process without running into serialization issues. """ # First try to get from __dict__ to handle dynamic docstring changes if "apply" in cls.__dict__: apply_fn = cls.__dict__["apply"] else: # Fall back to getattr for inherited methods apply_fn = getattr(cls, "apply", None) if apply_fn is None: raise AttributeError(f"apply method not defined in {cls}. Did you forget to implement it?") return func_metadata(apply_fn, skip_names=["self", "cls"])