Skip to main content
Glama
googleanalytics

Google Analytics MCP Server

Official

list_property_annotations

Retrieve annotations for a Google Analytics property to document service releases, marketing campaigns, and traffic changes on specific dates.

Instructions

Returns annotations for a property.

Annotations are a feature that allows you to leave notes on GA4 for specific dates or periods. They are typically used to record service releases, marketing campaign launches or changes, and rapid traffic increases or decreases due to external factors. Args: property_id: The Google Analytics property ID. Accepted formats are: - A number - A string consisting of 'properties/' followed by a number

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
property_idYes

Implementation Reference

  • The handler function for the 'list_property_annotations' tool. It is decorated with @mcp.tool() which also serves as registration. Retrieves property annotations using Google Analytics Admin API v1alpha, paginates results, converts protos to dicts, and returns a list of annotations.
    @mcp.tool(title="Gets property annotations for a property") async def list_property_annotations( property_id: int | str, ) -> List[Dict[str, Any]]: """Returns annotations for a property. Annotations are a feature that allows you to leave notes on GA4 for specific dates or periods. They are typically used to record service releases, marketing campaign launches or changes, and rapid traffic increases or decreases due to external factors. Args: property_id: The Google Analytics property ID. Accepted formats are: - A number - A string consisting of 'properties/' followed by a number """ request = admin_v1alpha.ListReportingDataAnnotationsRequest( parent=construct_property_rn(property_id) ) annotations_pager = ( await create_admin_alpha_api_client().list_reporting_data_annotations( request=request ) ) all_pages = [ proto_to_dict(annotation_page) async for annotation_page in annotations_pager ] return all_pages

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/googleanalytics/google-analytics-mcp'

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