tags_delete
Remove tags from Piwik PRO Tag Manager to clean up configurations. This action permanently deletes tags from your analytics setup.
Instructions
Delete a tag from Piwik PRO Tag Manager.
Warning: This action is irreversible and will permanently delete the tag.
Args:
app_id: UUID of the app
tag_id: UUID of the tag
Returns:
Dictionary containing deletion status:
- status: "success" if deletion was successful
- message: Descriptive message about the deletion
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | Yes | ||
| tag_id | Yes |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | Yes | Operation status (success, error, etc.) | |
| message | Yes | Descriptive message about the operation |
Implementation Reference
- MCP tool registration and handler for 'tags_delete'. The @mcp.tool decorator registers the tool, and the function delegates execution to the delete_tag helper.
@mcp.tool(annotations={"title": "Piwik PRO: Delete Tag"}) def tags_delete(app_id: str, tag_id: str) -> OperationStatusResponse: """Delete a tag from Piwik PRO Tag Manager. Warning: This action is irreversible and will permanently delete the tag. Args: app_id: UUID of the app tag_id: UUID of the tag Returns: Dictionary containing deletion status: - status: "success" if deletion was successful - message: Descriptive message about the deletion """ return delete_tag(app_id, tag_id) - Core helper function that executes the tag deletion via Piwik PRO Tag Manager API client. Handles success response and various error cases.
def delete_tag(app_id: str, tag_id: str) -> OperationStatusResponse: try: client = create_piwik_client() client.tag_manager.delete_tag(app_id, tag_id) return OperationStatusResponse( status="success", message=f"Tag {tag_id} deleted successfully from app {app_id}", ) except NotFoundError: raise RuntimeError(f"Tag with ID {tag_id} not found in app {app_id}") except BadRequestError as e: raise RuntimeError(f"Failed to delete tag: {e.message}") except Exception as e: raise RuntimeError(f"Failed to delete tag: {str(e)}") - src/piwik_pro_mcp/tools/__init__.py:35-35 (registration)Top-level call to register_tag_tools(mcp) during register_all_tools, which indirectly registers the tags_delete tool.
register_tag_tools(mcp)