Skip to main content
Glama

tunnel_list

List active tunneled secrets to view IDs and metadata without exposing sensitive values, helping manage secure API key storage.

Instructions

List active tunneled secrets (IDs and metadata only, never values).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool registration and handler for 'tunnel_list'.
    server.tool(
      "tunnel_list",
      "List active tunneled secrets (IDs and metadata only, never values).",
      {},
      async () => {
        const tunnels = tunnelList();
        if (tunnels.length === 0) return text("No active tunnels");
    
        const lines = tunnels.map((t) => {
          const parts = [t.id];
          parts.push(`reads:${t.accessCount}`);
          if (t.maxReads) parts.push(`max:${t.maxReads}`);
          if (t.expiresAt) {
            const rem = Math.max(0, Math.floor((t.expiresAt - Date.now()) / 1000));
            parts.push(`expires:${rem}s`);
          }
          return parts.join(" | ");
        });
    
        return text(lines.join("\n"));
      },
    );
  • Core implementation function for listing tunneled secrets.
    export function tunnelList(): {
      id: string;
      createdAt: number;
      expiresAt?: number;
      accessCount: number;
      maxReads?: number;
    }[] {
      const now = Date.now();
      const result: ReturnType<typeof tunnelList> = [];
    
      for (const [id, entry] of tunnelStore) {
        if (entry.expiresAt && now >= entry.expiresAt) {
          tunnelStore.delete(id);
          continue;
        }
        result.push({
          id,
          createdAt: entry.createdAt,
          expiresAt: entry.expiresAt,
          accessCount: entry.accessCount,
          maxReads: entry.maxReads,
        });
      }
    
      return result;
    }

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/I4cTime/quantum_ring'

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