Skip to main content
Glama
capsulerun

Capsule Bash Server

Official

sessions

List active shell sessions to monitor ongoing processes in a sandboxed bash server.

Instructions

List all active shell sessions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'sessions' tool. Returns a JSON string with an array of all active session IDs from the sessions map.
    async () => {
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({ sessions: Array.from(sessions.keys()) }),
          },
        ],
      };
    },
  • Schema definition for the 'sessions' tool (no input parameters, only description).
    {
      description: 'List all active shell sessions.',
    },
  • Registration of the 'sessions' tool via server.registerTool().
    server.registerTool(
      'sessions',
      {
        description: 'List all active shell sessions.',
      },
      async () => {
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({ sessions: Array.from(sessions.keys()) }),
            },
          ],
        };
      },
    );
  • Helper function getSession() that manages the sessions map, creating new Bash instances as needed.
    function getSession(sessionId: string): Bash {
      if (!sessions.has(sessionId)) {
        sessions.set(
          sessionId,
          new Bash({
            runtime: new WasmRuntime(),
            hostWorkspace: `.capsule/sessions/${sessionId}`,
          }),
        );
      }
    
      return sessions.get(sessionId)!;
    }
  • The sessions map (Map<string, Bash>) that stores all active shell sessions.
    const sessions = new Map<string, Bash>();
Behavior3/5

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

With no annotations, the description carries full burden. It correctly implies a read-only operation by stating 'List', which is non-destructive. However, no further behavioral details (e.g., session scope, authentication) are disclosed.

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 a single sentence with no extraneous words, efficiently conveying the tool's purpose. It is appropriately front-loaded and concise.

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 has no parameters, no output schema, and a straightforward purpose, the description is fully complete. It covers all necessary information for an agent to select and invoke the tool correctly.

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

Parameters4/5

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

The input schema has zero parameters with 100% coverage, so the description naturally adds no parameter info. Baseline for no parameters is 4, as no additional semantics are needed.

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 'List all active shell sessions' uses a specific verb ('List') and resource ('active shell sessions'), clearly distinguishing it from sibling tools 'reset' and 'run' which perform different actions.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives, nor any exclusions or prerequisites. As a simple list tool, context is minimal, but explicit usage direction is absent.

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