Skip to main content
Glama

reset_session

Clear chat history while maintaining the session ID to start fresh when switching tasks. Ask the user before resetting.

Instructions

Reset a session's chat history (keep same session ID). Use for a clean slate when the task changes; ask the user before resetting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYesThe session ID to reset

Implementation Reference

  • The main handler function for the reset_session tool. Retrieves the session by ID, calls session.reset() to clear its chat history, and returns success/error status.
    /**
     * Handle reset_session tool
     */
    async handleResetSession(args: { session_id: string }): Promise<
      ToolResult<{ status: string; message: string; session_id: string }>
    > {
      const { session_id } = args;
    
      log.info(`🔧 [TOOL] reset_session called`);
      log.info(`  Session ID: ${session_id}`);
    
      try {
        const session = this.sessionManager.getSession(session_id);
    
        if (!session) {
          log.warning(`⚠️  [TOOL] Session ${session_id} not found`);
          return {
            success: false,
            error: `Session ${session_id} not found`,
          };
        }
    
        await session.reset();
    
        log.success(`✅ [TOOL] reset_session completed`);
        return {
          success: true,
          data: {
            status: "success",
            message: `Session ${session_id} reset successfully`,
            session_id,
          },
        };
      } catch (error) {
        const errorMessage =
          error instanceof Error ? error.message : String(error);
        log.error(`❌ [TOOL] reset_session failed: ${errorMessage}`);
        return {
          success: false,
          error: errorMessage,
        };
      }
    }
  • Tool definition including name, description, and input schema requiring 'session_id' string.
      {
        name: "reset_session",
        description:
          "Reset a session's chat history (keep same session ID). " +
          "Use for a clean slate when the task changes; ask the user before resetting.",
        inputSchema: {
          type: "object",
          properties: {
            session_id: {
              type: "string",
              description: "The session ID to reset",
            },
          },
          required: ["session_id"],
        },
      },
    ];
  • src/index.ts:242-246 (registration)
    Dispatches calls to the reset_session tool to the ToolHandlers.handleResetSession method in the main MCP server request handler.
    case "reset_session":
      result = await this.toolHandlers.handleResetSession(
        args as { session_id: string }
      );
      break;
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly indicates this is a destructive operation (resetting chat history) and specifies the session ID remains unchanged, which are important behavioral traits. However, it doesn't mention potential side effects like whether this affects other session data or if there are rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly concise with two sentences that each serve distinct purposes: the first states what the tool does, the second provides usage guidelines. There's zero wasted language and it's front-loaded with the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter destructive operation with no annotations and no output schema, the description provides excellent context about what the tool does and when to use it. The main gap is the lack of information about what exactly gets reset (just chat history or other session data) and what the response looks like, but the core functionality is well-covered.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already documents the single parameter 'session_id' adequately. The description doesn't add any additional parameter semantics beyond what's in the schema, which is acceptable given the high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Reset a session's chat history') and resource ('session'), with the clarifying detail 'keep same session ID' that distinguishes it from tools like 'close_session' which might terminate the session entirely. It provides a complete, unambiguous purpose statement.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use this tool ('Use for a clean slate when the task changes') and includes a critical behavioral guideline ('ask the user before resetting'), which provides clear context and distinguishes it from other session-related tools like 'list_sessions' or 'close_session'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/inventra/notebooklm-mcp'

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