Skip to main content
Glama
PiwikPRO

Piwik PRO MCP Server

Official
by PiwikPRO

tracker_settings_app_update

Update tracker settings for a specific app in Piwik PRO Analytics. Modify anonymization levels, session durations, campaign parameters, IP exclusions, and other tracking configurations using JSON attributes.

Instructions

Update tracker settings for a specific app using JSON attributes.

    This tool uses a simplified interface with 2 parameters: app_id and attributes.
    Use tools_parameters_get("tracker_settings_app_update") to get
    the complete JSON schema with all available fields, types, and validation rules.

    Args:
        app_id: UUID of the app
        attributes: Dictionary containing tracker settings attributes to update. All fields
                   are optional. Supported fields include anonymize_visitor_ip_level,
                   excluded_ips, session settings, campaign parameters, and more.

    Returns:
        Dictionary containing update status:
        - status: Update status
        - message: Descriptive message
        - updated_fields: List of fields that were updated

    Parameter Discovery:
        Use tools_parameters_get("tracker_settings_app_update") to get
        the complete JSON schema for all available fields. This returns validation rules,
        field types, and examples.

    Examples:
        # Get available parameters first
        schema = tools_parameters_get("tracker_settings_app_update")

        # Update basic settings
        attributes = {
            "anonymize_visitor_ip_level": 2,
            "excluded_ips": ["192.168.1.1", "10.0.0.1"]
        }

        # Update session and campaign settings
        attributes = {
            "session_max_duration_seconds": 3600,
            "campaign_name_params": ["utm_campaign", "campaign"],
            "exclude_crawlers": True
        }
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_idYes
attributesYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusYesUpdate status
messageYesDescriptive message about the update
updated_fieldsYesList of fields that were updated

Implementation Reference

  • MCP tool handler for tracker_settings_app_update. Decorated with @mcp.tool and implements the tool logic by calling the underlying update function after validation.
    @mcp.tool(annotations={"title": "Piwik PRO: Update App Tracker Settings"})
    def tracker_settings_app_update(app_id: str, attributes: dict) -> UpdateStatusResponse:
        """Update tracker settings for a specific app using JSON attributes.
    
        This tool uses a simplified interface with 2 parameters: app_id and attributes.
        Use tools_parameters_get("tracker_settings_app_update") to get
        the complete JSON schema with all available fields, types, and validation rules.
    
        Args:
            app_id: UUID of the app
            attributes: Dictionary containing tracker settings attributes to update. All fields
                       are optional. Supported fields include anonymize_visitor_ip_level,
                       excluded_ips, session settings, campaign parameters, and more.
    
        Returns:
            Dictionary containing update status:
            - status: Update status
            - message: Descriptive message
            - updated_fields: List of fields that were updated
    
        Parameter Discovery:
            Use tools_parameters_get("tracker_settings_app_update") to get
            the complete JSON schema for all available fields. This returns validation rules,
            field types, and examples.
    
        Examples:
            # Get available parameters first
            schema = tools_parameters_get("tracker_settings_app_update")
    
            # Update basic settings
            attributes = {
                "anonymize_visitor_ip_level": 2,
                "excluded_ips": ["192.168.1.1", "10.0.0.1"]
            }
    
            # Update session and campaign settings
            attributes = {
                "session_max_duration_seconds": 3600,
                "campaign_name_params": ["utm_campaign", "campaign"],
                "exclude_crawlers": True
            }
        """
        return update_app_tracker_settings(app_id, attributes)
  • Core helper function that performs the actual API call to update app tracker settings, including validation against AppTrackerSettings schema.
    def update_app_tracker_settings(app_id: str, attributes: dict) -> UpdateStatusResponse:
        try:
            client = create_piwik_client()
    
            # Validate attributes directly against the model
            validated_attrs = validate_data_against_model(attributes, AppTrackerSettings)
    
            # Convert to dictionary and filter out None values
            update_kwargs = {k: v for k, v in validated_attrs.model_dump(by_alias=True, exclude_none=True).items()}
    
            if not update_kwargs:
                raise RuntimeError("No update parameters provided")
    
            updated_fields = list(update_kwargs.keys())
            client.tracker_settings.update_app_settings(app_id, **update_kwargs)
    
            return UpdateStatusResponse(
                status="success",
                message=f"App {app_id} tracker settings updated successfully",
                updated_fields=updated_fields,
            )
        except NotFoundError:
            raise RuntimeError(f"App with ID {app_id} not found")
        except BadRequestError as e:
            raise RuntimeError(f"Failed to update app tracker settings: {e.message}")
        except Exception as e:
            raise RuntimeError(f"Failed to update app tracker settings: {str(e)}")
  • TOOL_PARAMETER_MODELS dictionary that maps 'tracker_settings_app_update' to the AppTrackerSettings Pydantic model for input validation and schema generation.
    TOOL_PARAMETER_MODELS: Dict[str, Type[BaseModel]] = {
        "apps_create": NewAppAttributes,
        "apps_update": AppEditableAttributes,
        "audiences_create": NewAudienceAttributes,
        "audiences_update": EditableAudienceAttributes,
        "tracker_settings_app_update": AppTrackerSettings,
        "tracker_settings_global_update": GlobalTrackerSettings,
        "tags_create": TagManagerCreateAttributes,
        "tags_update": TagManagerUpdateAttributes,
        "tags_list": TagFilters,
        "triggers_create": TriggerAttributes,
        "triggers_list": TriggerFilters,
        "variables_create": VariableCreateAttributes,
        "variables_update": VariableUpdateAttributes,
        "variables_list": VariableFilters,
    }
  • Registration call to register_tracker_settings_tools(mcp) in the central tools registration function, which includes the @mcp.tool decorator for this tool.
    register_tracker_settings_tools(mcp)
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses that this is an update operation (implying mutation) and describes the return format, but lacks details on permissions, side effects, error handling, or rate limits. The examples add some behavioral context but don't fully compensate for the missing annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is overly verbose and poorly structured. It repeats instructions about using 'tools_parameters_get' multiple times, includes extensive examples and formatting that add bulk without proportional value, and buries key information like the return format in the middle. It could be significantly streamlined for better front-loading.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (mutation with nested objects) and the presence of an output schema (which covers return values), the description is reasonably complete. It explains the purpose, parameters, and provides examples, though it lacks usage guidelines and some behavioral details. The output schema reduces the need for return value explanation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must compensate. It explains that 'app_id' is a UUID and 'attributes' is a dictionary with optional fields, listing examples like 'anonymize_visitor_ip_level' and 'excluded_ips'. This adds meaningful semantics beyond the bare schema, though it doesn't cover all possible fields comprehensively.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Update tracker settings for a specific app using JSON attributes.' It specifies the verb ('update'), resource ('tracker settings'), and target ('specific app'), though it doesn't explicitly differentiate from sibling tools like 'tracker_settings_global_update' or 'tracker_settings_app_get' beyond the 'app' focus.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions using 'tools_parameters_get' for schema details but doesn't compare to sibling tools like 'tracker_settings_global_update' for global settings or 'tracker_settings_app_get' for retrieval, leaving the agent without context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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