Skip to main content
Glama
alexander-zuev

Supabase MCP Server

live_dangerously

Switch between safe and unsafe modes for Supabase database or API operations. Enable unsafe mode to perform write operations or schema changes, then revert to safe mode for security.

Instructions

Toggle unsafe mode for either Management API or Database operations.

WHAT THIS TOOL DOES: This tool switches between safe (default) and unsafe operation modes for either the Management API or Database operations.

SAFETY MODES EXPLAINED:

  1. Database Safety Modes:

    • SAFE mode (default): Only low-risk operations like SELECT queries are allowed

    • UNSAFE mode: Higher-risk operations including INSERT, UPDATE, DELETE, and schema changes are permitted

  2. API Safety Modes:

    • SAFE mode (default): Only low-risk operations that don't modify state are allowed

    • UNSAFE mode: Higher-risk state-changing operations are permitted (except those explicitly blocked for safety)

OPERATION RISK LEVELS: The system categorizes operations by risk level:

  • LOW: Safe read operations with minimal impact

  • MEDIUM: Write operations that modify data but don't change structure

  • HIGH: Operations that modify database structure or important system settings

  • EXTREME: Destructive operations that could cause data loss or service disruption

WHEN TO USE THIS TOOL:

  • Use this tool BEFORE attempting write operations or schema changes

  • Enable unsafe mode only when you need to perform data modifications

  • Always return to safe mode after completing write operations

USAGE GUIDELINES:

  • Start in safe mode by default for exploration and analysis

  • Switch to unsafe mode only when you need to make changes

  • Be specific about which service you're enabling unsafe mode for

  • Consider the risks before enabling unsafe mode, especially for database operations

  • For database operations requiring schema changes, you'll need to enable unsafe mode first

Parameters:

  • service: Which service to toggle ("api" or "database")

  • enable_unsafe_mode: True to enable unsafe mode, False for safe mode (default: False)

Examples:

  1. Enable database unsafe mode: live_dangerously(service="database", enable_unsafe_mode=True)

  2. Return to safe mode after operations: live_dangerously(service="database", enable_unsafe_mode=False)

  3. Enable API unsafe mode: live_dangerously(service="api", enable_unsafe_mode=True)

Note: This tool affects ALL subsequent operations for the specified service until changed again.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
enable_unsafe_modeNo
serviceYes

Implementation Reference

  • MCP tool registration and handler function for 'live_dangerously'. This is the entrypoint decorated with @mcp.tool that delegates to the feature manager.
    @mcp.tool(description=tool_manager.get_description(ToolName.LIVE_DANGEROUSLY))  # type: ignore
    async def live_dangerously(
        service: Literal["api", "database"], enable_unsafe_mode: bool = False
    ) -> dict[str, Any]:
        """
        Toggle between safe and unsafe operation modes for API or Database services.
    
        This function controls the safety level for operations, allowing you to:
        - Enable write operations for the database (INSERT, UPDATE, DELETE, schema changes)
        - Enable state-changing operations for the Management API
        """
        return await feature_manager.execute_tool(
            ToolName.LIVE_DANGEROUSLY,
            services_container=services_container,
            service=service,
            enable_unsafe_mode=enable_unsafe_mode,
        )
  • Core handler implementing the logic of 'live_dangerously': toggles safety mode (SAFE/UNSAFE) for 'api' or 'database' services using the safety_manager.
    async def live_dangerously(
        self, container: "ServicesContainer", service: Literal["api", "database"], enable_unsafe_mode: bool = False
    ) -> dict[str, Any]:
        """
        Toggle between safe and unsafe operation modes for API or Database services.
    
        This function controls the safety level for operations, allowing you to:
        - Enable write operations for the database (INSERT, UPDATE, DELETE, schema changes)
        - Enable state-changing operations for the Management API
        """
        safety_manager = container.safety_manager
        if service == "api":
            # Set the safety mode in the safety manager
            new_mode = SafetyMode.UNSAFE if enable_unsafe_mode else SafetyMode.SAFE
            safety_manager.set_safety_mode(ClientType.API, new_mode)
    
            # Return the actual mode that was set
            return {"service": "api", "mode": safety_manager.get_safety_mode(ClientType.API)}
        elif service == "database":
            # Set the safety mode in the safety manager
            new_mode = SafetyMode.UNSAFE if enable_unsafe_mode else SafetyMode.SAFE
            safety_manager.set_safety_mode(ClientType.DATABASE, new_mode)
    
            # Return the actual mode that was set
            return {"service": "database", "mode": safety_manager.get_safety_mode(ClientType.DATABASE)}
  • Enum definition ToolName.LIVE_DANGEROUSLY registering the tool name used throughout the codebase.
    LIVE_DANGEROUSLY = "live_dangerously"
  • Input schema defined by function parameters: service (api|database), enable_unsafe_mode (bool). Output: dict.
    async def live_dangerously(
        service: Literal["api", "database"], enable_unsafe_mode: bool = False
    ) -> dict[str, Any]:
        """
        Toggle between safe and unsafe operation modes for API or Database services.
    
        This function controls the safety level for operations, allowing you to:
        - Enable write operations for the database (INSERT, UPDATE, DELETE, schema changes)
        - Enable state-changing operations for the Management API
        """
        return await feature_manager.execute_tool(
            ToolName.LIVE_DANGEROUSLY,
            services_container=services_container,
            service=service,
            enable_unsafe_mode=enable_unsafe_mode,
        )
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure and does so comprehensively. It explains the safety modes in detail (SAFE vs. UNSAFE for both Database and API), describes risk levels (LOW, MEDIUM, HIGH, EXTREME), and explicitly states that the tool 'affects ALL subsequent operations for the specified service until changed again,' which is crucial behavioral context not evident from the schema alone.

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 well-structured with clear sections (WHAT THIS TOOL DOES, SAFETY MODES EXPLAINED, etc.) and front-loads the core purpose. While comprehensive, some sections like OPERATION RISK LEVELS could be slightly more concise, but every sentence adds valuable context for a safety-critical tool.

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

Completeness5/5

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

For a tool with 2 parameters, 0% schema description coverage, no annotations, and no output schema, the description provides complete context. It explains what the tool does, when to use it, detailed behavioral implications, parameter meanings, examples, and important notes about persistence of the mode change. No additional information is needed for an agent to use this tool correctly.

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?

With 0% schema description coverage, the description fully compensates by explaining both parameters in detail. It defines 'service' as 'api' or 'database' with clear explanations of what each service controls, and explains 'enable_unsafe_mode' as a boolean with default False, including specific examples of how to use both parameters together in different scenarios.

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 clearly states the tool 'switches between safe (default) and unsafe operation modes for either the Management API or Database operations,' providing a specific verb ('toggle'/'switch') and resources (API/Database). It distinguishes from siblings by focusing on safety mode configuration rather than direct operations like execute_postgresql or send_management_api_request.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool ('BEFORE attempting write operations or schema changes'), when not to use it ('Start in safe mode by default for exploration and analysis'), and provides clear alternatives (safe vs. unsafe modes). It also gives specific guidance on risk considerations and returning to safe mode after operations.

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/alexander-zuev/supabase-mcp-server'

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