Skip to main content
Glama
FradSer

mcp-server-osascript

by FradSer

execute_osascript

Run AppleScript and JavaScript scripts using osascript with automatic macOS permission handling, security profiles, and dry-run execution for risk analysis.

Instructions

    Execute or analyze scripts using osascript with comprehensive functionality and automatic permission handling.

    This unified tool handles both AppleScript/JavaScript execution and security analysis with full osascript
    capabilities including shell script execution and intelligent TCC permission management.

    Security Profiles:
    - "strict": Maximum security, blocks potentially dangerous operations
    - "balanced": Recommended default, warns about risks but allows execution
    - "permissive": Minimal restrictions, full functionality with audit logging

    Features:
    - Complete osascript support for AppleScript and JavaScript
    - Shell script execution via "do shell script"
    - Automatic TCC permission dialog handling
    - Intelligent error recovery and user guidance
    - Security risk assessment and warnings
    - Comprehensive execution logging
    - Dry-run mode for analysis without execution

    Args:
        script: The script code to execute or analyze (AppleScript or JavaScript for osascript)
        execution_timeout: Maximum execution time in seconds (default: 30, ignored in dry_run)
        security_profile: Security mode ("strict", "balanced", "permissive")
        enable_auto_permissions: Automatically handle macOS permission dialogs (default: True)
        dry_run: If True, only analyze security without executing (default: False)

    Returns:
        Standardized response with execution results, security analysis, and guidance
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYes
dry_runNo
security_profileNobalanced
execution_timeoutNo
enable_auto_permissionsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

No annotations are provided, so the description carries full behavioral disclosure. It explicitly mentions automatic TCC permission dialog handling, dry-run mode, security risk assessment, error recovery, and logging—significant behavioral details beyond simple execution. It does not cover every possible side effect, but the disclosure is substantial and well above a bare-bones description.

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

Conciseness4/5

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

The description is organized with clear sections (Security Profiles, Features, Args, Returns) and front-loads the core purpose. Some redundancy exists (e.g., Features list partially repeats Args), but each section contains necessary information for a complex tool without excessive verbosity.

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

Completeness4/5

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

Given the tool's complexity (5 parameters, output schema present), the description covers the main behavioral aspects: execution scope, security modes, dry-run, and return type. It does not delve into all edge cases or output schema specifics, but the combination of features, security profiles, and parameter explanations provides a solid contextual foundation for invocation.

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

Parameters5/5

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

Schema description coverage is 0%, but the description fully compensates with an 'Args:' section defining each parameter (script, execution_timeout, security_profile, enable_auto_permissions, dry_run) including defaults and allowed security profile values. This adds meaning beyond the schema, which only lists properties without descriptions.

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

Purpose5/5

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

The description opens with 'Execute or analyze scripts using osascript with comprehensive functionality and automatic permission handling,' which clearly identifies the action (execute/analyze), resource (osascript scripts), and distinguishes from siblings by also covering security analysis and profile handling. The tool's unified nature makes its purpose unambiguous.

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

Usage Guidelines3/5

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

The description explains security profiles and dry-run mode but never explicitly states when to choose this tool over the sibling tools get_security_profiles or set_security_profile. Usage context is implied through features, but there are no direct alternatives, exclusions, or selection criteria provided.

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/FradSer/mcp-server-osascript'

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