Skip to main content
Glama

list-terminals

Retrieve a list of all active iTerm2 terminal sessions with their current information and status for session management.

Instructions

List all active terminals and their information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list-terminals' tool. It retrieves active terminals from the global 'terminals' Map, computes the count and list of IDs, and returns a formatted text response with this information.
    async () => { const activeTerminals = Array.from(terminals.entries()).map(([id]) => id); const count = terminals.size; return { content: [ { type: "text", text: `Number of active terminals: ${count}\nActive terminal IDs: ${ activeTerminals.join(", ") || "None" }`, }, ], }; }
  • index.js:243-262 (registration)
    Registration of the 'list-terminals' tool with McpServer.tool(). Includes name, description, empty schema, and inline handler function.
    server.tool( "list-terminals", "List all active terminals and their information", {}, async () => { const activeTerminals = Array.from(terminals.entries()).map(([id]) => id); const count = terminals.size; return { content: [ { type: "text", text: `Number of active terminals: ${count}\nActive terminal IDs: ${ activeTerminals.join(", ") || "None" }`, }, ], }; } );
  • Global Map storing active terminals, used by the 'list-terminals' handler to list them.
    const terminals = new Map();

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/rishabkoul/iTerm-MCP-Server'

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