Skip to main content
Provider methods are additional capabilities that providers expose beyond the basic query and notify capabilities (read more here). These methods allow you to interact with the provider’s API in more specific ways, enabling richer integrations and automation capabilities.

What are provider methods?

Developers define provider methods using the PROVIDER_METHODS list in each provider class. They represent specific actions or queries that you can perform through the provider’s API. These methods extend the basic capabilities of providers beyond simple notifications and queries.
For example, a monitoring service provider might expose methods to:
  • Mute/unmute alerts
  • Get detailed traces
  • Search for specific metrics
  • Modify monitoring configurations

Using provider methods

You can access provider methods through:
  • Keep’s platform interface via the alert action menu
  • Keep’s smart AI assistant (for example, “get traces for this alert”)
  • Keep’s API
  • Keep’s workflows

Via UI

Methods appear in the alert action menu when available for the alert’s source provider:
The form is automatically populated with the parameters required by the method, if they’re available in the alert.

Via AI assistant

Keep’s AI assistant can automatically discover and invoke provider methods based on natural language requests by understanding multiple contexts:
  1. Alert Context: The AI understands:
    • The alert’s source provider
    • Alert metadata and attributes
    • Related services and applications
    • Current alert status and severity
  2. Provider Context: The AI knows:
    • Which providers you have connected to your account
    • Available methods for each provider
    • Required parameters and their types
    • Method descriptions and capabilities
  3. Historical Context: The AI learns from:
    • Similar past incidents
    • Previously successful method invocations
    • Common patterns in alert resolution
For example:
The AI assistant automatically:
  1. Identifies relevant provider methods
  2. Extracts required parameters from context
  3. Suggests appropriate actions based on the alert type
  4. Chains multiple methods for comprehensive investigation

Via API

Adding new provider methods

To add a new method to your provider:
  1. Define the method in your provider class (must be an instance method):
  1. Add method metadata to PROVIDER_METHODS:
Note: The func_params field is automatically populated by Keep through reflection of the method signature, so you don’t need to define it manually.
Provider methods must be instance methods (not static or class methods) of the provider class. The method signature is automatically inspected to generate UI forms and parameter validation.

Complete example

Here’s a complete example of a provider with custom methods:

Method types

  • view: Returns data for display (for example, getting traces, metrics)
  • action: Performs an action (for example, muting an alert, creating a ticket)

Parameter types

Supported parameter types for provider methods:
  • str: String input field
  • int: Numeric input field
  • float: Decimal number input field
  • bool: Boolean checkbox
  • datetime: Date/time picker
  • dict: JSON object input
  • list: Array/list input
  • Literal: Dropdown with predefined values
  • Optional[type]: Optional parameter of the specified type
Example with different parameter types:

Auto-discovery

Keep automatically inspects provider classes to:
  1. Discover available methods
  2. Extract parameter information
  3. Generate UI components
  4. Enable AI understanding of method capabilities

Best practices

  1. Clear Documentation: Provide detailed docstrings for methods
  2. Type Hints: Use Python type hints for parameters
  3. Error Handling: Return clear error messages
  4. Scopes: Define minimum required scopes
  5. Validation: Validate parameters before execution

Limitations

  • Currently supports only synchronous methods
  • The supported parameter types are limited to basic types
  • Methods must be instance methods of the provider class
  • Methods are automatically discovered through reflection
  • Keep validates parameter types based on type hints