Skip to main content
Glama
d3v1an
by d3v1an

ssh_history

View and filter executed operations from the active SSH connection to monitor command history and track reversible actions.

Instructions

Muestra el historial de operaciones ejecutadas durante la conexión activa. Permite filtrar por tipo de operación y limitar resultados

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoFiltro del historial: 'all' (todas), 'reversible' (solo reversibles), 'reversed' (solo revertidas). Default: 'all'
limitNoNúmero máximo de registros a retornar (default: 20)

Implementation Reference

  • Implementation of the ssh_history tool handler.
    private handleHistory(args: any): CallToolResult {
      this.requireConnection();
      const filter = (args?.filter as string) || "all";
      const limit = (args?.limit as number) || 20;
    
      let records = [...this.commandHistory];
    
      if (filter === "reversible") {
        records = records.filter((r) => r.reversible && !r.reversed);
      } else if (filter === "reversed") {
        records = records.filter((r) => r.reversed);
      }
    
      records = records.slice(-limit);
    
      if (records.length === 0) {
        return {
          content: [{ type: "text", text: "No hay operaciones en el historial con el filtro aplicado." }],
        };
      }
    
      const lines = records.map((r) => {
        const status = r.reversed ? " [REVERTIDA]" : r.reversible ? " [reversible]" : "";
        const params = Object.entries(r.params)
          .map(([k, v]) => `${k}=${v}`)
          .join(", ");
        return `#${r.id} [${r.timestamp}] ${r.tool}(${params})${status}`;
      });
    
      return {
        content: [
          {
            type: "text",
            text: [
              `Historial de operaciones (${records.length}/${this.commandHistory.length} total):`,
              "",
              ...lines,
            ].join("\n"),
          },
        ],
      };
    }
  • src/tools.ts:276-294 (registration)
    Definition and registration of the ssh_history tool.
      name: "ssh_history",
      description:
        "Muestra el historial de operaciones ejecutadas durante la conexión activa. Permite filtrar por tipo de operación y limitar resultados",
      inputSchema: {
        type: "object",
        properties: {
          filter: {
            type: "string",
            enum: ["all", "reversible", "reversed"],
            description:
              "Filtro del historial: 'all' (todas), 'reversible' (solo reversibles), 'reversed' (solo revertidas). Default: 'all'",
          },
          limit: {
            type: "number",
            description: "Número máximo de registros a retornar (default: 20)",
          },
        },
      },
    },

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/d3v1an/ssh-mcp'

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