Skip to main content
Glama

get_current_tmux_info

Retrieve current tmux session details to enable macOS notifications that can focus specific tmux windows when clicked, integrating system alerts with terminal workflows.

Instructions

Get current tmux session information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that executes tmux display-message commands to fetch current session, window, and pane information.
    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:91-98 (registration)
    Tool registration in the listTools response, including name, description, and empty input schema.
    { name: 'get_current_tmux_info', description: 'Get current tmux session information', inputSchema: { type: 'object', properties: {}, }, },
  • MCP CallToolRequestSchema handler case that invokes the notifier function and formats the 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', }, ], } }
  • Type definition for the output structure returned by getCurrentTmuxInfo.
    session: string window: string pane: string }

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