Skip to main content
Glama

prepare_for_new_conversation

Initiate a fresh conversation by resetting context and preparing for new interactions. Use this tool to start a clean dialogue with Serena, ensuring clarity and focus in coding discussions.

Instructions

Instructions for preparing for a new conversation. This tool should only be called on explicit user request.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler implementation: PrepareForNewConversationTool.apply() returns a generated prompt via the prompt factory for preparing context for a new conversation.
    class PrepareForNewConversationTool(Tool): """ Provides instructions for preparing for a new conversation (in order to continue with the necessary context). """ def apply(self) -> str: """ Instructions for preparing for a new conversation. This tool should only be called on explicit user request. """ return self.prompt_factory.create_prepare_for_new_conversation()
  • Helper method in the generated prompt factory that renders the 'prepare_for_new_conversation' prompt template.
    def create_prepare_for_new_conversation(self) -> str: return self._render_prompt("prepare_for_new_conversation", locals())
  • ToolRegistry discovers and registers all Tool subclasses from serena.tools modules, mapping PrepareForNewConversationTool to 'prepare_for_new_conversation'.
    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)
  • SerenaAgent instantiates all registered tools, including PrepareForNewConversationTool, during initialization.
    self._all_tools: dict[type[Tool], Tool] = {tool_class: tool_class(self) for tool_class in ToolRegistry().get_all_tool_classes()}
  • Import of workflow_tools ensures PrepareForNewConversationTool is discoverable by ToolRegistry subclass scan.
    from .workflow_tools import *

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/oraios/serena'

If you have feedback or need assistance with the MCP directory API, please join our Discord server