Skip to main content
Glama

analyticsdata.properties.audienceExports.query

Retrieve users from a Google Analytics 4 audience export after creating it; query with limit and offset to page through segmented user data.

Instructions

Retrieves an audience export of users. After creating an audience, the users are not immediately available for exporting. First, a request to CreateAudienceExport is necessary to create an audience export of users, and then second, this method is used to retrieve the users in the audience export. See Creating an Audience Export for an introduction to Audience Exports with examples. Audiences in Google Analytics 4 allow you to segment your users in the ways that are important to your business. To learn [HTTP POST] — creates or triggers a change; refused under --readonly safety profiles. Returns the API's response resource as JSON — request body is a JSON QueryAudienceExportRequest object accepting limit, offset; pass it via params or whole via body_file Siblings over the same resource: create, get, list.

Input Schema

NameRequiredDescriptionDefault
nameYes[URL path segment] Required. The name of the audience export to retrieve users from. Format: `properties/{property}/audienceExports/{audience_export}`
queryNoExtra KEY=VALUE query pairs for endpoints whose parameters Discovery does not describe.
paramsNoParameter map merged into the request; typed parameters win.
dry_runNoReturn the request that would be sent, without sending it.
body_fileNoRead the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON QueryAudienceExportRequest object.
request_bodyNoRequest body of type QueryAudienceExportRequest: pass it via `params` (merged into the built body) or whole via `body_file`.

Output Schema

NameRequiredDescriptionDefault
rowCountNo
audienceRowsNo
audienceExportNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / body_file / description
      Previous value: -"Read the request body from this file ('-' for stdin) instead of building one from the parameters."New value: +"Read the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON QueryAudienceExportRequest object."
    • addedInput schema / properties / request_body
      Added value: +{
      +  "description": "Request body of type QueryAudienceExportRequest: pass it via `params` (merged into the built body) or whole via `body_file`.",
      +  "properties": {
      +    "limit": {
      +      "type": "string"
      +    },
      +    "offset": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed3 schema fields changed
    • changedInput schema / properties / name / description
      Previous value: -"Required. The name of the audience export to retrieve users from. Format: `properties/{property}/audienceExports/{audience_export}`"New value: +"[URL path segment] Required. The name of the audience export to retrieve users from. Format: `properties/{property}/audienceExports/{audience_export}`"
    • addedInput schema / properties / name / pattern
      Added value: +"^properties/[^/]+/audienceExports/[^/]+$"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "audienceExport": {
      +      "properties": {
      +        "audience": {
      +          "type": "string"
      +        },
      +        "audienceDisplayName": {
      +          "type": "string"
      +        },
      +        "beginCreatingTime": {
      +          "type": "string"
      +        },
      +        "creationQuotaTokensCharged": {
      +          "type": "integer"
      +        },
      +        "dimensions": {
      +          "items": {
      +            "properties": {
      +              "dimensionName": {
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "errorMessage": {
      +          "type": "string"
      +        },
      +        "name": {
      +          "type": "string"
      +        },
      +        "percentageCompleted": {
      +          "type": "number"
      +        },
      +        "rowCount": {
      +          "type": "integer"
      +        },
      +        "state": {
      +          "enum": [
      +            "STATE_UNSPECIFIED",
      +            "CREATING",
      +            "ACTIVE",
      +            "FAILED"
      +          ],
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "audienceRows": {
      +      "items": {
      +        "properties": {
      +          "dimensionValues": {
      +            "items": {
      +              "properties": {
      +                "value": {
      +                  "type": "string"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "type": "array"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "rowCount": {
      +      "type": "integer"
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observed

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden and does disclose useful details: it returns the API response as JSON, accepts a QueryAudienceExportRequest body, and supports params or body_file. However, the injected line 'HTTP POST — creates or triggers a change; refused under --readonly safety profiles' is confusing for a query/retrieval tool and may misleadingly imply mutation, while auth and rate-limit behavior are not covered.

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 first sentence is front-loaded and useful, but the description then includes generic audience-segmentation background and a truncated, broken fragment ('To learn [HTTP POST]') that reads like concatenated system notes. The structure is messy and several clauses do not earn their place.

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?

An output schema exists, so return values need not be explained, and the description covers the key prerequisite and body-passing mechanics. Still, given no annotations and multiple sibling tools over the same resource, it should more clearly distinguish query from get/list and clarify the read-vs-POST semantics.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents the name, query, params, dry_run, body_file, and request_body fields. The description adds only that the request body accepts limit and offset and can be passed via params or body_file, which is helpful but mostly duplicative of the structured schema.

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 opening sentence clearly states the specific action and resource: retrieving users from an audience export, and the prerequisite CreateAudienceExport step distinguishes it from the sibling create tool. However, the text is interrupted by a broken fragment ('To learn [HTTP POST]') and generic GA4 audience background, which slightly muddies an otherwise clear purpose.

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

Usage Guidelines4/5

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

It explicitly states the required sequence: first call CreateAudienceExport, then use this method to retrieve users. It also names sibling operations create, get, and list, though it does not explain when to use get or list instead of query.

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

Deploy Server

Other Tools