Skip to main content
Glama
yuki-yano

macOS Notify MCP

by yuki-yano

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
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but doesn't describe any behavioral traits - no information about what 'current' means operationally, whether this requires specific tmux environment, what format the information returns, or any error conditions. The description is minimal and lacks behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just 5 words - 'Get current tmux session information'. It's front-loaded with the core purpose and contains no unnecessary words or sentences. Every word earns its place in conveying the basic function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no annotations, no output schema, and a sibling tool with similar purpose ('list_tmux_sessions'), the description is insufficiently complete. It doesn't explain what 'current' means versus 'list', what information is returned, or how this tool differs from its sibling. For a tool that presumably returns data, the lack of output description is a significant gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the schema already fully documents the parameter situation. The description appropriately doesn't mention parameters since none exist. This meets the baseline expectation for parameterless tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get current tmux session information' clearly states the verb ('Get') and resource ('current tmux session information'), making the purpose understandable. However, it doesn't distinguish this from the sibling tool 'list_tmux_sessions' - both appear to retrieve tmux session data, so the distinction between 'current' and 'list' isn't clarified.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus the sibling 'list_tmux_sessions'. The description implies it retrieves 'current' information, but doesn't specify what 'current' means in this context or when you would choose this over listing all sessions. No alternatives or exclusions are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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