Skip to main content
Glama
googleanalytics

Google Analytics MCP Server

Official

get_account_summaries

Fetches a summary of all Google Analytics accounts and their associated properties.

Instructions

Retrieves information about the user's Google Analytics accounts and properties.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler for get_account_summaries. Calls the Google Analytics Admin API list_account_summaries() via create_admin_api_client(), converts each proto response to dict using proto_to_dict, and runs the synchronous API call in a thread via asyncio.to_thread.
    async def get_account_summaries() -> List[Dict[str, Any]]:
        """Retrieves information about the user's Google Analytics accounts and properties."""
    
        def _sync_call():
            summary_pager = create_admin_api_client().list_account_summaries()
            return [proto_to_dict(summary_page) for summary_page in summary_pager]
    
        return await asyncio.to_thread(_sync_call)
  • Registration of get_account_summaries as an ADK FunctionTool, added to the tools list which is then converted to MCP tools and exposed via the MCP server.
    tools = [
        FunctionTool(get_account_summaries),
        FunctionTool(list_google_ads_links),
        FunctionTool(get_property_details),
        FunctionTool(list_property_annotations),
        FunctionTool(get_custom_dimensions_and_metrics),
        run_report_with_description,
        run_realtime_report_with_description,
        run_funnel_report_with_description,
    ]
  • Helper that creates the Admin API client used by get_account_summaries to call list_account_summaries.
    def create_admin_api_client() -> admin_v1beta.AnalyticsAdminServiceClient:
        """Returns the Google Analytics Admin API client."""
        with _client_lock:
            return admin_v1beta.AnalyticsAdminServiceClient(
                client_info=_CLIENT_INFO, credentials=_get_credentials()
            )
  • Helper utility used to convert the proto response from list_account_summaries into a dictionary.
    def proto_to_dict(obj: proto.Message) -> Dict[str, Any]:
        """Converts a proto message to a dictionary."""
        return type(obj).to_dict(
            obj, use_integers_for_enums=False, preserving_proto_field_name=True
        )
  • No input parameters (schema is an empty object). Returns a list of dicts containing account/property summaries.
    async def get_account_summaries() -> List[Dict[str, Any]]:
        """Retrieves information about the user's Google Analytics accounts and properties."""
    
        def _sync_call():
            summary_pager = create_admin_api_client().list_account_summaries()
            return [proto_to_dict(summary_page) for summary_page in summary_pager]
    
        return await asyncio.to_thread(_sync_call)
Behavior2/5

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

Without annotations, the description carries the full burden but only states 'retrieves information.' It does not disclose any behavioral traits such as authentication requirements, rate limits, or error handling.

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 a single concise sentence with no redundancy. However, it lacks structure such as separating key details.

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

Completeness2/5

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

Given no output schema and no annotations, the description is the sole source of context. It fails to specify return format, pagination, or any constraints, making it inadequate for an agent to fully understand the tool's behavior.

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?

The input schema has zero parameters, so no parameter documentation is needed. The description does not need to add meaning beyond the schema, and the baseline for zero-parameter tools is 4.

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 it retrieves information about the user's Google Analytics accounts and properties, indicating a read operation on a specific resource. However, it does not differentiate from sibling tools like get_property_details, which may retrieve more specific property-level data.

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?

No guidance is provided on when to use this tool versus alternatives. With multiple sibling tools for Google Analytics data, the description lacks context for proper 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/googleanalytics/google-analytics-mcp'

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