Skip to main content
Glama
yuki-yano

macOS Notify MCP

by yuki-yano

list_tmux_sessions

Retrieve available tmux sessions to enable targeted macOS notifications that focus specific sessions when clicked.

Instructions

List available tmux sessions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main tool handler for 'list_tmux_sessions' that invokes notifier.listSessions() and formats the result into a 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',
          },
        ],
      }
    }
  • Schema definition for the 'list_tmux_sessions' tool, specifying name, description, and empty input schema (no parameters required).
    {
      name: 'list_tmux_sessions',
      description: 'List available tmux sessions',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • src/index.ts:42-101 (registration)
    Registration of the tool via the ListToolsRequest handler, which statically returns the list of available tools including 'list_tmux_sessions'.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            name: 'send_notification',
            description: 'Send a macOS notification with optional tmux integration',
            inputSchema: {
              type: 'object',
              properties: {
                message: {
                  type: 'string',
                  description: 'The notification message',
                },
                title: {
                  type: 'string',
                  description: 'The notification title (default: "Claude Code")',
                },
                sound: {
                  type: 'string',
                  description: 'The notification sound (default: "Glass")',
                },
                session: {
                  type: 'string',
                  description: 'tmux session name',
                },
                window: {
                  type: 'string',
                  description: 'tmux window number',
                },
                pane: {
                  type: 'string',
                  description: 'tmux pane number',
                },
                useCurrent: {
                  type: 'boolean',
                  description: 'Use current tmux location',
                },
              },
              required: ['message'],
            },
          },
          {
            name: 'list_tmux_sessions',
            description: 'List available tmux sessions',
            inputSchema: {
              type: 'object',
              properties: {},
            },
          },
          {
            name: 'get_current_tmux_info',
            description: 'Get current tmux session information',
            inputSchema: {
              type: 'object',
              properties: {},
            },
          },
        ],
      }
    })
  • Core helper function that executes 'tmux list-sessions -F #{session_name}' to retrieve the list of tmux sessions.
    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 []
      }
    }
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 how it behaves—no information on output format, error conditions, permissions needed, or whether it's read-only/destructive. This is inadequate for a tool with zero annotation coverage.

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 a single, efficient sentence with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a simple tool, making it easy for an agent to parse quickly.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., session names, IDs, status) or any behavioral context, which is essential for an agent to use it effectively. The simplicity of 0 parameters doesn't compensate for these gaps.

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 lack of inputs. The description doesn't need to add parameter information, and it correctly doesn't mention any, earning a baseline score of 4 for appropriate compensation.

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

Purpose4/5

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

The description clearly states the verb ('List') and resource ('available tmux sessions'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_current_tmux_info' which might overlap in functionality, preventing a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'get_current_tmux_info' or 'send_notification'. There's no mention of context, prerequisites, or exclusions, leaving the agent to infer usage from tool names alone.

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