Skip to main content
Glama
googleanalytics

Google Analytics MCP Server

Official

Gets property annotations for a property

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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
Behavior2/5

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

With no annotations provided, the description carries full burden but lacks critical behavioral details. It doesn't disclose whether this is a read-only operation (implied by 'Returns' but not explicit), authentication requirements, rate limits, pagination behavior, or what happens with invalid property IDs. The description adds useful context about annotation purposes but misses operational transparency.

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

Conciseness4/5

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

The description is appropriately sized with three focused paragraphs: purpose statement, annotation context, and parameter details. The front-loaded purpose sentence earns its place, though the middle paragraph about annotation uses could be slightly more concise.

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

Completeness3/5

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

Given 1 parameter with good semantic coverage and an output schema exists (so return values needn't be described), the description is moderately complete. However, for a tool with no annotations, it should better address behavioral aspects like read-only nature, error conditions, and authentication needs to be fully complete.

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

Parameters5/5

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

With 0% schema description coverage and only 1 parameter, the description fully compensates by providing essential semantic information. It explains property_id accepts both numeric and string formats with the 'properties/' prefix pattern, which is crucial for correct usage beyond what the bare schema indicates.

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 verb 'Returns' and resource 'annotations for a property', specifying it's about GA4 property annotations. It distinguishes from siblings by focusing on annotations rather than reports, links, or summaries. However, it doesn't explicitly differentiate from potential sibling annotation tools (none listed).

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

Usage Guidelines3/5

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

The description provides context about what annotations are used for (recording releases, campaigns, traffic changes), which implies when this tool might be useful. However, it doesn't explicitly state when to use this vs. alternatives like run_report for data analysis, or mention prerequisites like needing property access.

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

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