list_tmux_sessions
Retrieve available tmux sessions to integrate with macOS notifications, enabling focused session management directly from the notification interface.
Instructions
List available tmux sessions
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:176-189 (handler)MCP tool handler for 'list_tmux_sessions' that lists available tmux sessions via notifier.listSessions() and returns a formatted text response.case 'list_tmux_sessions': { const sessions = await notifier.listSessions() return { content: [ { type: 'text', text: sessions.length > 0 ? `Available tmux sessions:\n${sessions.map((s) => `- ${s}`).join('\n')}` : 'No tmux sessions found', }, ], } }
- src/index.ts:83-90 (registration)Registration of the 'list_tmux_sessions' tool in the ListToolsRequestHandler response, defining its name, description, and input schema.{ name: 'list_tmux_sessions', description: 'List available tmux sessions', inputSchema: { type: 'object', properties: {}, }, },
- src/notifier.ts:421-432 (helper)Supporting utility method in TmuxNotifier class that executes the 'tmux list-sessions -F #{session_name}' command to retrieve the list of tmux session names.async listSessions(): Promise<string[]> { try { const output = await this.runCommand('tmux', [ 'list-sessions', '-F', '#{session_name}', ]) return output.trim().split('\n').filter(Boolean) } catch (_error) { return [] } }