Skip to main content
Glama
alexander-zuev

Supabase MCP Server

call_auth_admin_method

Authenticate and manage Supabase users securely by calling Auth Admin methods. Perform tasks like creating, updating, deleting users, generating links, and managing multi-factor authentication. Inputs are validated for safety.

Instructions

Call an Auth Admin method from Supabase Python SDK.

This tool provides a safe, validated interface to the Supabase Auth Admin SDK, allowing you to:

  • Manage users (create, update, delete)

  • List and search users

  • Generate authentication links

  • Manage multi-factor authentication

  • And more

IMPORTANT NOTES:

  • Request bodies must adhere to the Python SDK specification

  • Some methods may have nested parameter structures

  • The tool validates all parameters against Pydantic models

  • Extra fields not defined in the models will be rejected

AVAILABLE METHODS:

  • get_user_by_id: Retrieve a user by their ID

  • list_users: List all users with pagination

  • create_user: Create a new user

  • delete_user: Delete a user by their ID

  • invite_user_by_email: Send an invite link to a user's email

  • generate_link: Generate an email link for various authentication purposes

  • update_user_by_id: Update user attributes by ID

  • delete_factor: Delete a factor on a user

EXAMPLES:

  1. Get user by ID: method: "get_user_by_id" params: {"uid": "user-uuid-here"}

  2. Create user: method: "create_user" params: { "email": "user@example.com", "password": "secure-password" }

  3. Update user by ID: method: "update_user_by_id" params: { "uid": "user-uuid-here", "attributes": { "email": "new@email.com" } }

For complete documentation of all methods and their parameters, use the get_auth_admin_methods_spec tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodYes
paramsYes

Implementation Reference

  • MCP tool handler for 'call_auth_admin_method', decorated with @mcp.tool and registers the tool. Delegates to feature_manager.execute_tool.
    @mcp.tool(description=tool_manager.get_description(ToolName.CALL_AUTH_ADMIN_METHOD))  # type: ignore
    async def call_auth_admin_method(method: str, params: dict[str, Any]) -> dict[str, Any]:
        """Call an Auth Admin method from Supabase Python SDK."""
        return await feature_manager.execute_tool(
            ToolName.CALL_AUTH_ADMIN_METHOD, services_container=services_container, method=method, params=params
        )
  • Intermediate wrapper in feature_manager that invokes the sdk_client's call_auth_admin_method after feature access check (via execute_tool).
    async def call_auth_admin_method(
        self, container: "ServicesContainer", method: str, params: dict[str, Any]
    ) -> dict[str, Any]:
        """Call an Auth Admin method from Supabase Python SDK."""
        sdk_client = container.sdk_client
        return await sdk_client.call_auth_admin_method(method, params)
  • Core implementation of call_auth_admin_method: validates input params using Pydantic models (PARAM_MODELS), checks service role key, dispatches to specific handlers (_get_user_by_id, _create_user, etc.) that invoke the Supabase Python SDK auth.admin methods.
    async def call_auth_admin_method(self, method: str, params: dict[str, Any]) -> Any:
        """Calls a method of the Python SDK client"""
        # Check if service role key is available
        if not self.service_role_key:
            raise PythonSDKError(
                "Supabase service role key is not configured. Set SUPABASE_SERVICE_ROLE_KEY environment variable to use Auth Admin tools."
            )
    
        if not self.client:
            self.client = await self.get_client()
            if not self.client:
                raise PythonSDKError("Python SDK client not initialized")
    
        # Validate method exists
        if method not in PARAM_MODELS:
            available_methods = ", ".join(PARAM_MODELS.keys())
            raise PythonSDKError(f"Unknown method: {method}. Available methods: {available_methods}")
    
        # Get the appropriate model class and validate parameters
        param_model_cls = PARAM_MODELS[method]
        validated_params = self._validate_params(method, params, param_model_cls)
    
        # Method dispatch using a dictionary of method implementations
        method_handlers = {
            "get_user_by_id": self._get_user_by_id,
            "list_users": self._list_users,
            "create_user": self._create_user,
            "delete_user": self._delete_user,
            "invite_user_by_email": self._invite_user_by_email,
            "generate_link": self._generate_link,
            "update_user_by_id": self._update_user_by_id,
            "delete_factor": self._delete_factor,
        }
    
        # Call the appropriate method handler
        try:
            handler = method_handlers.get(method)
            if not handler:
                raise PythonSDKError(f"Method {method} is not implemented")
    
            logger.debug(f"Python SDK request params: {validated_params}")
            return await handler(validated_params)
        except Exception as e:
            if isinstance(e, IncorrectSDKParamsError):
                # Re-raise our custom error without wrapping it
                raise e
            logger.error(f"Error calling {method}: {e}")
            raise PythonSDKError(f"Error calling {method}: {str(e)}") from e
  • ToolName enum definition for CALL_AUTH_ADMIN_METHOD, used in registration and dispatching.
    CALL_AUTH_ADMIN_METHOD = "call_auth_admin_method"
Behavior4/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. It effectively describes key traits: it's a 'safe, validated interface' that validates parameters against Pydantic models and rejects extra fields. It mentions that 'some methods may have nested parameter structures' and provides examples of destructive operations (delete_user, delete_factor). However, it doesn't cover rate limits, authentication requirements, or error handling.

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

Conciseness3/5

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

The description is appropriately front-loaded with the core purpose and key capabilities, but it includes extensive lists and examples that could be streamlined. The 'AVAILABLE METHODS' section and multiple examples add value but make the description lengthy. Every sentence earns its place, but the structure could be more concise by integrating examples more tightly or referencing external documentation earlier.

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 complexity (2 parameters with nested objects, no output schema, no annotations), the description is largely complete. It covers purpose, usage, behavioral traits, and parameter semantics thoroughly. However, it lacks details on return values (since no output schema exists) and doesn't mention authentication or error scenarios. The reference to 'get_auth_admin_methods_spec' for full documentation helps mitigate gaps.

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?

The input schema has 0% description coverage and only defines 'method' (string) and 'params' (object) without semantic details. The description compensates fully by listing all available methods with brief explanations (e.g., 'get_user_by_id: Retrieve a user by their ID'), providing detailed examples with parameter structures, and explaining that parameters must adhere to Python SDK specifications. This adds substantial meaning beyond the minimal schema.

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's purpose: 'Call an Auth Admin method from Supabase Python SDK' with a specific verb ('call') and resource ('Auth Admin method'). It distinguishes from siblings like 'get_auth_admin_methods_spec' (which retrieves documentation) and 'send_management_api_request' (which handles different API types). The bullet points further clarify capabilities like user management and authentication tasks.

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 provides explicit guidance on when to use this tool vs alternatives. It states to 'use the get_auth_admin_methods_spec tool' for complete documentation of methods and parameters, distinguishing it from that sibling. The 'IMPORTANT NOTES' section also outlines prerequisites like adhering to Python SDK specifications and validation rules, though it doesn't explicitly mention when not to use it.

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