Skip to main content
Glama

session-status

Check active or sleeping session status, view scope restrictions, and monitor time remaining before auto-sleep in the SecureCode MCP server.

Instructions

Check the current session status: active or sleeping, scope restrictions, and time remaining before auto-sleep.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Implementation of the "session-status" tool, which queries the securecode client for session status and formats the response for the MCP server.
    // Tool: session-status
    server.tool(
      'session-status',
      'Check the current session status: active or sleeping, scope restrictions, and time remaining before auto-sleep.',
      {},
      async () => {
        try {
          const client = getClient();
          const s = await client.getSessionStatus();
          const scopeText = s.scope
            ? s.scope.map(f => Object.entries(f).map(([k, v]) => `${k}:${v}`).join(' AND ')).join(' OR ')
            : 'All secrets';
          const timeText = s.timeRemainingMinutes !== null
            ? `${s.timeRemainingMinutes} min`
            : 'N/A';
          const lines = [
            `Session: ${s.status === 'active' ? 'Active' : 'Sleeping (locked)'}`,
            `Scope: ${scopeText}`,
            `Auto-sleep: ${s.autoSleepMinutes} min`,
          ];
          if (s.status === 'active') {
            lines.push(`Time remaining: ${timeText}`);
          }
          if (s.wakeAt) lines.push(`Last wake: ${new Date(s.wakeAt).toLocaleString()}`);
          if (s.sleepAt) lines.push(`Last sleep: ${new Date(s.sleepAt).toLocaleString()}`);
          return wrapResponse([{ type: 'text' as const, text: lines.join('\n') }]);
        } catch (e) {
          return errorResult(e);
        }
      },
    );

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/juanisidoro/securecode-mcp'

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