Skip to main content
Glama
lxman

Safari MCP Server

by lxman

safari_list_sessions

Retrieve all active Safari browser sessions to monitor and manage open tabs and windows for browser automation tasks.

Instructions

List all active Safari sessions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'safari_list_sessions' tool, including its name, description, and input schema (no required parameters).
    {
      name: 'safari_list_sessions',
      description: 'List all active Safari sessions',
      inputSchema: {
        type: 'object',
        properties: {}
      }
    },
  • The main handler function for 'safari_list_sessions'. Calls driverManager.getAllSessions() and formats the list of active session IDs as a text response.
    private async listSessions(): Promise<Array<{ type: string; text: string }>> {
      const sessions = this.driverManager.getAllSessions();
      
      return [
        {
          type: 'text',
          text: `Active Safari Sessions (${sessions.length}):\n${sessions.join('\n')}`
        }
      ];
    }
  • Supporting helper method in SafariDriverManager that returns all active session IDs from the internal Map.
    getAllSessions(): string[] {
      return Array.from(this.sessions.keys());
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. 'List all active Safari sessions' implies a read-only operation, but it doesn't disclose behavioral traits like whether this requires specific permissions, what format the output takes (e.g., list of session IDs, detailed objects), if there are rate limits, or if it affects system state. The description is minimal and lacks necessary context for safe invocation.

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, clear sentence with zero waste. It's appropriately sized for a simple tool and front-loaded with the core purpose. Every word earns its place, making it highly concise and well-structured.

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 complexity (a read operation with no parameters) and lack of annotations and output schema, the description is incomplete. It doesn't explain what 'active Safari sessions' means, what data is returned, or any prerequisites. For a tool that might return structured session data, more context is needed to understand the output format and usage implications.

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, and schema description coverage is 100% (empty schema). With no parameters to document, the description doesn't need to add parameter semantics. A baseline of 4 is appropriate since there's no parameter information to provide beyond what the schema already covers (which is nothing).

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 ('all active Safari sessions'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'safari_get_page_info' or 'safari_get_console_logs' which might also retrieve session-related information, so it doesn't achieve full 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. With siblings like 'safari_start_session' and 'safari_close_session', it's unclear if this tool should be used for monitoring active sessions versus other purposes. No explicit when/when-not instructions or alternative references are included.

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/lxman/safari-mcp-server'

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