Skip to main content
Glama
PiwikPRO

Piwik PRO MCP Server

Official
by PiwikPRO

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
NameRequiredDescriptionDefault
app_idYes
tag_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusYesOperation status (success, error, etc.)
messageYesDescriptive 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)}")
  • Top-level call to register_tag_tools(mcp) during register_all_tools, which indirectly registers the tags_delete tool.
    register_tag_tools(mcp)

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