Skip to main content
Glama

prepare_for_new_conversation

Reset conversation context to start fresh interactions, clearing previous chat history and settings on user request.

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

  • PrepareForNewConversationTool class defines the tool handler. Its apply() method executes the tool logic by calling the prompt factory to generate the preparation instructions 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()
  • PromptFactory method that renders the prompt template named 'prepare_for_new_conversation', used by the tool handler.
    def create_prepare_for_new_conversation(self) -> str: return self._render_prompt("prepare_for_new_conversation", locals())
  • ToolRegistry automatically discovers and registers all Tool subclasses (including PrepareForNewConversationTool) by iterating subclasses in serena.tools package.
    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)

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