Skip to main content
Glama
googleanalytics

Google Analytics MCP Server

Official

get_property_details

Retrieve detailed information about a Google Analytics property by providing its property ID to access configuration and metadata.

Instructions

Returns details about a property. 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 implementing the get_property_details tool. It uses the Google Analytics Admin API to fetch and return property details, decorated with @mcp.tool() for registration.
    @mcp.tool(title="Gets details about a property")
    async def get_property_details(property_id: int | str) -> Dict[str, Any]:
        """Returns details about a property.
        Args:
            property_id: The Google Analytics property ID. Accepted formats are:
              - A number
              - A string consisting of 'properties/' followed by a number
        """
        client = create_admin_api_client()
        request = admin_v1beta.GetPropertyRequest(
            name=construct_property_rn(property_id)
        )
        response = await client.get_property(request=request)
        return proto_to_dict(response)

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