Skip to main content
Glama

os_notification

Read-only

Send system-level notifications directly from the MCP Tools interface. Display custom messages and titles using native OS notification systems for real-time alerts and updates.

Instructions

Send OS notifications using native notification systems.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesThe notification message to display
titleNoDefaults to current project, generally omit

Implementation Reference

  • Handler function that destructures args, selects notification strategy, executes the OS command, and returns a confirmation message.
    handler: (args) => {
      const { message, title = basename(util.CWD) } = args
      const strategy = getStrategy()
      const cmd = strategy.cmd(title, message)
      util.execSync(cmd, { stdio: 'ignore' })
      return `Notification would have been sent via ${strategy.check} with title "${title}" and message "${message}"`
    },
  • Zod schema validating the input parameters: required 'message' string and optional 'title' string.
    schema: z.object({
      message: z.string().min(1).describe('The notification message to display'),
      title: z.string().optional().describe('Defaults to current project, generally omit'),
    }),
  • src/tools.ts:22-31 (registration)
    Central tools registry object where 'os_notification' is registered by assigning the imported tool, and exported as default.
    const tools = {
      read_symbol: readSymbol,
      import_symbol: importSymbol,
      search_replace: searchReplace,
      insert_text: insertText,
      os_notification: osNotification,
      utils_debug: utilsDebug,
    } as const satisfies Record<string, Tool<any>>
    
    export default tools
  • Memoized function to select the first available OS notification strategy by checking which command is available.
    const getStrategy = _.memoize((): NotificationStrategy => {
      for (const strategy of strategies) {
        try {
          util.execSync(`command -v ${strategy.check}`, { stdio: 'ignore' })
          return strategy
        } catch {
          // Try next strategy
        }
      }
      throw new Error('No notification method available. Install notify-send, osascript, powershell, or wsl-notify-send')
    })
  • Array of platform-specific notification strategies, each with a check command and cmd generator for different OS notification methods.
    const strategies: NotificationStrategy[] = [
      {
        check: 'notify-send',
        cmd: (title, message) => `notify-send "${title}" "${message}"`,
      },
      {
        check: 'osascript',
        cmd: (title, message) => `osascript -e 'display notification "${message}" with title "${title}"'`,
      },
      {
        check: 'powershell',
        cmd: (title, message) => `powershell -Command "Add-Type -AssemblyName System.Windows.Forms; \\$notify = New-Object System.Windows.Forms.NotifyIcon; \\$notify.Icon = [System.Drawing.SystemIcons]::Information; \\$notify.BalloonTipTitle = '${title}'; \\$notify.BalloonTipText = '${message}'; \\$notify.Visible = \\$true; \\$notify.ShowBalloonTip(5000); Start-Sleep -Seconds 2; \\$notify.Dispose()"`,
      },
      {
        check: 'powershell.exe',
        cmd: (title, message) => `powershell.exe -Command "Add-Type -AssemblyName System.Windows.Forms; \\$notify = New-Object System.Windows.Forms.NotifyIcon; \\$notify.Icon = [System.Drawing.SystemIcons]::Information; \\$notify.BalloonTipTitle = '${title}'; \\$notify.BalloonTipText = '${message}'; \\$notify.Visible = \\$true; \\$notify.ShowBalloonTip(5000); Start-Sleep -Seconds 2; \\$notify.Dispose()"`,
      },
      {
        check: 'wsl-notify-send.exe',
        cmd: (title, message) => `wsl-notify-send.exe --category "${title}" "${message}"`,
      },
    ]
Behavior3/5

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

Annotations indicate readOnlyHint=true and openWorldHint=false, suggesting a safe, non-destructive operation with limited scope. The description adds context by specifying 'native notification systems,' implying platform-specific behavior, but doesn't detail aspects like permission requirements, notification duration, or user interaction effects beyond what annotations cover.

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 no wasted words, clearly stating the tool's function. It's appropriately sized and front-loaded, making it easy to understand at a glance without unnecessary elaboration.

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

Completeness3/5

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

Given the tool's low complexity (2 parameters, no output schema) and annotations covering safety, the description is minimally adequate. However, it lacks details on behavioral outcomes (e.g., how notifications appear or are dismissed) and doesn't compensate for the absence of an output schema, leaving gaps in understanding the tool's full impact.

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

Parameters3/5

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

Schema description coverage is 100%, with clear documentation for both parameters ('message' and 'title'). The description doesn't add meaning beyond the schema, such as examples or edge cases, but the schema adequately defines parameters, meeting the baseline for high coverage.

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 action ('Send') and target ('OS notifications using native notification systems'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'insert_text' or 'read_symbol', which are unrelated to notifications, so it lacks explicit sibling differentiation.

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 or in what context it's appropriate. There's no mention of prerequisites, limitations, or scenarios where this tool is preferred over other notification methods, leaving usage entirely implicit.

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

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/flesler/mcp-files'

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