Skip to main content
Glama
capsulerun

Capsule Bash Server

Official

reset

Restore a session's filesystem and shell state to their initial values, enabling a clean start without creating a new session.

Instructions

Reset a session's filesystem and shell state (cwd, env vars) to their initial values. Useful to start fresh without creating a new session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idNoThe session to reset. Defaults to 'default'.default

Implementation Reference

  • The MCP server registers the 'reset' tool with input schema (session_id optional string) and a handler that retrieves the Bash session and calls bash.reset().
    server.registerTool(
      'reset',
      {
        description:
          "Reset a session's filesystem and shell state (cwd, env vars) to their initial values. Useful to start fresh without creating a new session.",
        inputSchema: {
          session_id: z
            .string()
            .optional()
            .default('default')
            .describe("The session to reset. Defaults to 'default'."),
        },
      },
      async ({ session_id }) => {
        const bash = getSession(session_id ?? 'default');
    
        bash.reset();
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({ ok: true, session_id: session_id ?? 'default' }),
            },
          ],
        };
      },
    );
  • Input schema for the reset tool: optional session_id string with default 'default'.
    inputSchema: {
      session_id: z
        .string()
        .optional()
        .default('default')
        .describe("The session to reset. Defaults to 'default'."),
    },
  • The Bash class reset() method delegates to both filesystem.reset() and stateManager.reset() to restore initial state.
    reset() {
      this.filesystem.reset();
      this.stateManager.reset();
    }
  • Resets the session's shell state: cwd back to '/workspace', env cleared, lastExitCode set to 0.
    public reset() {
      this.state.cwd = '/workspace';
      this.state.env = {};
      this.state.lastExitCode = 0;
    }
  • Resets the session's filesystem by deleting everything and re-initializing with default directories and files.
    reset() {
      fs.rmSync(this.workspace, { recursive: true, force: true });
      this.init();
    }
Behavior4/5

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

With no annotations, the description carries the full burden. It clearly explains that the tool resets filesystem and shell state to initial values, which is specific and transparent about the behavior. No side effects or additional information is provided, but the action is straightforward.

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 consists of two sentences, both front-loaded with essential information: the action and scope in the first sentence, usage context in the second. No wasted words.

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

Completeness5/5

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

Given the tool's simplicity (one parameter, no output schema), the description provides all necessary information: what it does, what it affects, and when to use it. No gaps remain.

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 input schema has 100% description coverage, and the description adds no additional meaning beyond what the schema already provides for the single parameter 'session_id'. Baseline of 3 is appropriate.

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 verb 'reset' and the resource 'session's filesystem and shell state', specifying what is reset (cwd, env vars) and distinguishing from siblings 'run' and 'sessions' which have different purposes.

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

Usage Guidelines4/5

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

The description explicitly says 'useful to start fresh without creating a new session', giving a clear usage scenario and implying an alternative (creating a new session). However, it does not explicitly state when not to use it or list other alternatives.

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/capsulerun/bash'

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