Skip to main content
Glama

get_current_tmux_info

Retrieve active tmux session details to enable macOS notifications tied to specific sessions, enhancing workflow focus and productivity.

Instructions

Get current tmux session information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core implementation of getCurrentTmuxInfo: runs tmux display-message commands to fetch current session name, window index, and pane index.
    async getCurrentTmuxInfo(): Promise<TmuxInfo | null> { try { const session = ( await this.runCommand('tmux', [ 'display-message', '-p', '#{session_name}', ]) ).trim() const window = ( await this.runCommand('tmux', [ 'display-message', '-p', '#{window_index}', ]) ).trim() const pane = ( await this.runCommand('tmux', [ 'display-message', '-p', '#{pane_index}', ]) ).trim() return { session, window, pane } } catch (_error) { return null } }
  • src/index.ts:191-211 (registration)
    MCP server handler for the 'get_current_tmux_info' tool call, delegates to notifier.getCurrentTmuxInfo() and formats response.
    case 'get_current_tmux_info': { const info = await notifier.getCurrentTmuxInfo() if (info) { return { content: [ { type: 'text', text: `Current tmux location:\n- Session: ${info.session}\n- Window: ${info.window}\n- Pane: ${info.pane}`, }, ], } } return { content: [ { type: 'text', text: 'Not in a tmux session', }, ], } }
  • src/index.ts:92-98 (registration)
    Tool registration in listTools response: defines name, description, and empty input schema.
    name: 'get_current_tmux_info', description: 'Get current tmux session information', inputSchema: { type: 'object', properties: {}, }, },
  • Type definition for TmuxInfo returned by getCurrentTmuxInfo.
    session: string window: string pane: string }

Other Tools

Related Tools

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/yuki-yano/macos-notify-mcp'

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