Skip to main content
Glama
PiwikPRO

Piwik PRO MCP Server

Official
by PiwikPRO

triggers_get

Retrieve detailed configuration and conditions for a specific trigger in Piwik PRO Analytics, including its attributes, template, and operational settings.

Instructions

Get detailed information about a specific trigger.

    Args:
        app_id: UUID of the app
        trigger_id: UUID of the trigger

    Returns:
        Dictionary containing trigger details including:
        - data: Trigger object with id, name, template, and all attributes
        - Trigger conditions and configuration

    Related Tools:
        - piwik_get_trigger_tags() - See what tags are assigned to this trigger
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_idYes
trigger_idYes

Implementation Reference

  • The MCP tool handler function 'triggers_get' decorated with @mcp.tool decorator. It handles the tool execution by calling the internal get_trigger helper to fetch trigger details from the API.
    @mcp.tool(annotations={"title": "Piwik PRO: Get Trigger", "readOnlyHint": True})
    def triggers_get(app_id: str, trigger_id: str) -> TagManagerSingleResponse:
        """Get detailed information about a specific trigger.
    
        Args:
            app_id: UUID of the app
            trigger_id: UUID of the trigger
    
        Returns:
            Dictionary containing trigger details including:
            - data: Trigger object with id, name, template, and all attributes
            - Trigger conditions and configuration
    
        Related Tools:
            - piwik_get_trigger_tags() - See what tags are assigned to this trigger
        """
        return get_trigger(app_id, trigger_id)
  • Helper function that performs the actual API call to retrieve a single trigger's details using the Piwik PRO client and wraps it in TagManagerSingleResponse.
    def get_trigger(app_id: str, trigger_id: str) -> TagManagerSingleResponse:
        try:
            client = create_piwik_client()
            response = client.tag_manager.get_trigger(app_id, trigger_id)
            return TagManagerSingleResponse(**response)
        except NotFoundError:
            raise RuntimeError(f"Trigger with ID {trigger_id} not found in app {app_id}")
        except Exception as e:
            raise RuntimeError(f"Failed to get trigger: {str(e)}")
  • Top-level registration of trigger tools, including 'triggers_get', called during overall tools registration in the MCP server setup.
    register_trigger_tools(mcp)
  • The registration function that defines and registers the 'triggers_get' tool using the @mcp.tool decorator inside it.
    def register_trigger_tools(mcp: FastMCP) -> None:

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/PiwikPRO/mcp'

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