Skip to main content
Glama

Discovery Lookup

discovery_lookup

Return up to 25 masked sample rows for audience matching criteria. Accepts: filters (raw Filter objects), segment_id, audience_id, segment_ids+set_logic (optionally with excluded_segment_ids for an ad-hoc "A minus B" preview), or filter_groups. All inputs are mutually exclusive — providing more than one is rejected with AMBIGUOUS_INPUT. Saved compositions and their exclusions are preserved. Requires 'discovery' scope.

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum masked sample rows, 1–25 (default 10)
fieldsNoNon-PII audience fields to preview; defaults to a small demographic selection. Discover fields with get_field_catalog.
filtersNoRaw flat Filter objects
set_logicNoHow to combine segment_ids
segment_idNoSaved segment ID (any subtype) — resolve its definition from the segment doc
audience_idNoSaved audience ID — resolve its composition via segment memberships (any subtype mix)
segment_idsNoMultiple segment IDs to compose
filter_groupsNoAdvanced compound filter groups
excluded_segment_idsNoAd-hoc "A minus B" preview — segments to subtract from the segment_ids composition, without persisting an audience

Output Schema

NameRequiredDescriptionDefault
rowsYesMasked sample records
guidanceNoInterpretation or recovery guidance for this result
count_unitNo
page_countNoNumber of objects on this page, not the organization total
count_stateNoUnknown means no count; available does not guarantee freshness. Recount for a current value.
next_actionsNoSuggested next calls using returned IDs and available scopes. Not executed and not user consent.
money_displayNoCurrency amounts formatted once from source paths ending in _cents. Use verbatim; do not divide again. Null/missing source amounts are omitted, not zero.
total_matchedYesNumber of records matching the lookup
available_fieldsYesNon-PII fields selected for this sample; use get_field_catalog to discover other fields
population_inputNoPopulation input used for the preview; IDs refer to their current saved definitions

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed23 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / criteria
      Removed value: -{
      -  "description": "Simple demographic criteria; choose this or one other population input, not both",
      -  "properties": {
      -    "age_max": {
      -      "description": "Maximum age in years",
      -      "type": "number"
      -    },
      -    "age_min": {
      -      "description": "Minimum age in years",
      -      "type": "number"
      -    },
      -    "genders": {
      -      "description": "Gender labels to include",
      -      "items": {
      -        "type": "string"
      -      },
      -      "type": "array"
      -    },
      -    "income_max": {
      -      "description": "Legacy input; ignored because household income is categorical. Use field-catalog filters instead.",
      -      "type": "number"
      -    },
      -    "income_min": {
      -      "description": "Legacy input; ignored because household income is categorical. Use field-catalog filters instead.",
      -      "type": "number"
      -    },
      -    "interests": {
      -      "description": "Interest labels to include",
      -      "items": {
      -        "type": "string"
      -      },
      -      "type": "array"
      -    },
      -    "states": {
      -      "description": "US state abbreviations to include",
      -      "items": {
      -        "type": "string"
      -      },
      -      "type": "array"
      -    },
      -    "zip_codes": {
      -      "description": "Five-digit ZIP codes to include",
      -      "items": {
      -        "type": "string"
      -      },
      -      "type": "array"
      -    }
      -  },
      -  "type": "object"
      -}
    • addedInput schema / properties / fields
      Added value: +{
      +  "description": "Non-PII audience fields to preview; defaults to a small demographic selection. Discover fields with get_field_catalog.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "maxItems": 30,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • changedInput schema / properties / filter_groups / items / additionalProperties
      Previous value: -{}New value: +false
    • addedInput schema / properties / filter_groups / items / properties
      Added value: +{
      +  "combinator": {
      +    "description": "Join to the preceding included group; ignored for the first group. AND binds before OR. Exclusion groups always subtract.",
      +    "enum": [
      +      "AND",
      +      "OR"
      +    ],
      +    "type": "string"
      +  },
      +  "filters": {
      +    "description": "All conditions in this group must match",
      +    "items": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "field": {
      +          "description": "field_name from get_field_catalog; ZIP5 also accepts zip, zip_code or postal_code. Use published operators and enum_values",
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "op": {
      +          "enum": [
      +            "=",
      +            "!=",
      +            "<",
      +            "<=",
      +            ">",
      +            ">=",
      +            "IN",
      +            "NOT IN",
      +            "BETWEEN",
      +            "LIKE",
      +            "ARRAY_CONTAINS",
      +            "ARRAY_CONTAINS_ANY",
      +            "IS NULL",
      +            "IS NOT NULL"
      +          ],
      +          "type": "string"
      +        },
      +        "text_comparison": {
      +          "description": "STRING =, !=, IN, NOT IN, LIKE and ARRAY<STRING> ARRAY_CONTAINS, ARRAY_CONTAINS_ANY. Default exact. case_insensitive applies Unicode case folding to stored text and the supplied value; use when capitalization is incidental.",
      +          "enum": [
      +            "exact",
      +            "case_insensitive"
      +          ],
      +          "type": "string"
      +        },
      +        "trim_whitespace": {
      +          "description": "Supported STRING or ARRAY<STRING> comparisons only. Trim leading/trailing whitespace on both sides; default false.",
      +          "type": "boolean"
      +        },
      +        "value": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "number"
      +            },
      +            {
      +              "type": "boolean"
      +            },
      +            {
      +              "items": {
      +                "anyOf": [
      +                  {
      +                    "type": "string"
      +                  },
      +                  {
      +                    "type": "number"
      +                  },
      +                  {
      +                    "type": "boolean"
      +                  }
      +                ]
      +              },
      +              "type": "array"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "Scalar for comparisons; array for IN/NOT IN; ARRAY_CONTAINS_ANY matches any listed value; [lower, upper] inclusive for BETWEEN; LIKE uses % for any sequence and _ for one character; omit for IS NULL/IS NOT NULL. Use enum_values codes, not display labels"
      +        }
      +      },
      +      "required": [
      +        "field",
      +        "op"
      +      ],
      +      "type": "object"
      +    },
      +    "minItems": 1,
      +    "type": "array"
      +  },
      +  "id": {
      +    "description": "Caller-chosen group ID, for example geography; prefix _exclude:: to subtract this group",
      +    "minLength": 1,
      +    "type": "string"
      +  }
      +}
    • removedInput schema / properties / filter_groups / items / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
    • addedInput schema / properties / filter_groups / items / required
      Added value: +[
      +  "id",
      +  "combinator",
      +  "filters"
      +]
    • changedInput schema / properties / filters / items / additionalProperties
      Previous value: -{}New value: +false
    • addedInput schema / properties / filters / items / properties
      Added value: +{
      +  "field": {
      +    "description": "field_name from get_field_catalog; ZIP5 also accepts zip, zip_code or postal_code. Use published operators and enum_values",
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "op": {
      +    "enum": [
      +      "=",
      +      "!=",
      +      "<",
      +      "<=",
      +      ">",
      +      ">=",
      +      "IN",
      +      "NOT IN",
      +      "BETWEEN",
      +      "LIKE",
      +      "ARRAY_CONTAINS",
      +      "ARRAY_CONTAINS_ANY",
      +      "IS NULL",
      +      "IS NOT NULL"
      +    ],
      +    "type": "string"
      +  },
      +  "text_comparison": {
      +    "description": "STRING =, !=, IN, NOT IN, LIKE and ARRAY<STRING> ARRAY_CONTAINS, ARRAY_CONTAINS_ANY. Default exact. case_insensitive applies Unicode case folding to stored text and the supplied value; use when capitalization is incidental.",
      +    "enum": [
      +      "exact",
      +      "case_insensitive"
      +    ],
      +    "type": "string"
      +  },
      +  "trim_whitespace": {
      +    "description": "Supported STRING or ARRAY<STRING> comparisons only. Trim leading/trailing whitespace on both sides; default false.",
      +    "type": "boolean"
      +  },
      +  "value": {
      +    "anyOf": [
      +      {
      +        "type": "string"
      +      },
      +      {
      +        "type": "number"
      +      },
      +      {
      +        "type": "boolean"
      +      },
      +      {
      +        "items": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "number"
      +            },
      +            {
      +              "type": "boolean"
      +            }
      +          ]
      +        },
      +        "type": "array"
      +      },
      +      {
      +        "type": "null"
      +      }
      +    ],
      +    "description": "Scalar for comparisons; array for IN/NOT IN; ARRAY_CONTAINS_ANY matches any listed value; [lower, upper] inclusive for BETWEEN; LIKE uses % for any sequence and _ for one character; omit for IS NULL/IS NOT NULL. Use enum_values codes, not display labels"
      +  }
      +}
    • removedInput schema / properties / filters / items / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
    • addedInput schema / properties / filters / items / required
      Added value: +[
      +  "field",
      +  "op"
      +]
    • changedInput schema / properties / limit / type
      Previous value: -"number"New value: +"integer"
    • changedOutput schema / properties / available_fields / description
      Previous value: -"Fields available in the audience graph"New value: +"Non-PII fields selected for this sample; use get_field_catalog to discover other fields"
    • removedOutput schema / properties / bytes_scanned
      Removed value: -{
      -  "description": "Measured query bytes scanned",
      -  "type": "number"
      -}
    • addedOutput schema / properties / count_state
      Added value: +{
      +  "description": "Unknown means no count; available does not guarantee freshness. Recount for a current value.",
      +  "enum": [
      +    "unknown",
      +    "available"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / count_unit
      Added value: +{
      +  "const": "records",
      +  "type": "string"
      +}
    • removedOutput schema / properties / estimated_cost_usd
      Removed value: -{
      -  "description": "Estimated query cost in US dollars",
      -  "type": "number"
      -}
    • addedOutput schema / properties / guidance
      Added value: +{
      +  "description": "Interpretation or recovery guidance for this result",
      +  "type": "string"
      +}
    • addedOutput schema / properties / money_display
      Added value: +{
      +  "additionalProperties": {
      +    "type": "string"
      +  },
      +  "description": "Currency amounts formatted once from source paths ending in _cents. Use verbatim; do not divide again. Null/missing source amounts are omitted, not zero.",
      +  "propertyNames": {
      +    "type": "string"
      +  },
      +  "type": "object"
      +}
    • addedOutput schema / properties / next_actions
      Added value: +{
      +  "description": "Suggested next calls using returned IDs and available scopes. Not executed and not user consent.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "arguments": {
      +        "additionalProperties": {},
      +        "propertyNames": {
      +          "type": "string"
      +        },
      +        "type": "object"
      +      },
      +      "reason": {
      +        "type": "string"
      +      },
      +      "tool": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "tool",
      +      "arguments",
      +      "reason"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / page_count
      Added value: +{
      +  "description": "Number of objects on this page, not the organization total",
      +  "maximum": 9007199254740991,
      +  "minimum": -9007199254740991,
      +  "type": "integer"
      +}
    • addedOutput schema / properties / population_input
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Population input used for the preview; IDs refer to their current saved definitions",
      +  "propertyNames": {
      +    "type": "string"
      +  },
      +  "type": "object"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "rows",
      -  "total_matched",
      -  "bytes_scanned",
      -  "estimated_cost_usd",
      -  "available_fields"
      -]New value: +[
      +  "rows",
      +  "total_matched",
      +  "available_fields"
      +]
  2. First observed

TDQS

A3.7/5.0
Behavior4/5

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

The description adds substantial context beyond the annotations: the 'discovery' scope requirement (an auth prerequisite), the masked nature of returned rows, the mutual-exclusion rejection with a named error code, and the fact that saved compositions/exclusions are preserved and excluded segment previews are not persisted. One unresolved tension: annotations declare readOnlyHint=false and idempotentHint=false, which imply state changes/side effects (e.g. metered queries) that the read-like 'return sample rows' framing does not explain.

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 output/scope statement is front-loaded, followed by the accepted input modes and the exclusivity rule. It is dense but nearly every clause carries operative information (error code, exclusion semantics, scope); it could be tightened marginally but wastes little.

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

Completeness4/5

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

With an output schema handling return values and full schema coverage on inputs, the description covers what structured fields cannot: auth scope, mutual-exclusion behavior, masking, and composition preservation. It is complete enough to invoke correctly, with only the readOnlyHint=false side-effect ambiguity left unaddressed.

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 coverage is 100%, so every parameter, including nested filter operators and BETWEEN/LIKE semantics, is already documented in the schema. The description adds only the higher-level mutual-exclusion rule and the 'A minus B' semantics of excluded_segment_ids, so the schema does most of the work and baseline 3 is appropriate.

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 states a specific verb and resource: "Return up to 25 masked sample rows for audience matching criteria," and enumerates the accepted input modes (filters, segment_id, audience_id, segment_ids+set_logic, filter_groups). It is clear what the tool produces. It does not, however, distinguish itself from the sibling discovery_count/discovery_crosstab/discovery_overlap tools, so an agent must infer that this is the row-preview variant.

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?

"All inputs are mutually exclusive — providing more than one is rejected with AMBIGUOUS_INPUT" gives real selection guidance among the input modes, and the excluded_segment_ids clause describes an ad-hoc preview path. But there is no explicit guidance on when to use this tool versus discovery_count or discovery_crosstab/the other discovery siblings, so usage is only implied.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources