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
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | Yes | ||
| trigger_id | Yes |
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)}") - src/piwik_pro_mcp/tools/__init__.py:36-36 (registration)Top-level registration of trigger tools, including 'triggers_get', called during overall tools registration in the MCP server setup.
register_trigger_tools(mcp) - src/piwik_pro_mcp/tools/tag_manager/triggers.py:122-122 (registration)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: