Skip to main content
Glama
This connector has been deprecated

Replaced by io.github.no-fait/infinite-audience

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.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "discovery_lookup"
  }
}

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.
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. Changed22 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 / 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. Changed11 schema fields changed
    • addedInput schema / properties / criteria / description
      Added value: +"Simple demographic criteria; choose this or one other population input, not both"
    • addedInput schema / properties / criteria / properties / age_max / description
      Added value: +"Maximum age in years"
    • addedInput schema / properties / criteria / properties / age_min / description
      Added value: +"Minimum age in years"
    • addedInput schema / properties / criteria / properties / genders / description
      Added value: +"Gender labels to include"
    • addedInput schema / properties / criteria / properties / income_max / description
      Added value: +"Legacy input; ignored because household income is categorical. Use field-catalog filters instead."
    • addedInput schema / properties / criteria / properties / income_min / description
      Added value: +"Legacy input; ignored because household income is categorical. Use field-catalog filters instead."
    • addedInput schema / properties / criteria / properties / interests / description
      Added value: +"Interest labels to include"
    • addedInput schema / properties / criteria / properties / states / description
      Added value: +"US state abbreviations to include"
    • addedInput schema / properties / criteria / properties / zip_codes / description
      Added value: +"Five-digit ZIP codes to include"
    • addedInput schema / properties / limit / description
      Added value: +"Maximum masked sample rows, 1–25 (default 10)"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "available_fields": {
      +      "description": "Fields available in the audience graph",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "bytes_scanned": {
      +      "description": "Measured query bytes scanned",
      +      "type": "number"
      +    },
      +    "estimated_cost_usd": {
      +      "description": "Estimated query cost in US dollars",
      +      "type": "number"
      +    },
      +    "rows": {
      +      "description": "Masked sample records",
      +      "items": {
      +        "additionalProperties": {},
      +        "propertyNames": {
      +          "type": "string"
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "total_matched": {
      +      "description": "Number of records matching the lookup",
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "rows",
      +    "total_matched",
      +    "bytes_scanned",
      +    "estimated_cost_usd",
      +    "available_fields"
      +  ],
      +  "type": "object"
      +}
  3. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Beyond the annotations it discloses the 'discovery' scope requirement, the AMBIGUOUS_INPUT rejection behavior, that saved compositions and their exclusions are preserved, and that excluded_segment_ids yields an ad-hoc preview without persisting an audience. That last phrase reads as non-mutating while readOnlyHint=false and idempotentHint=false suggest otherwise, but the description never asserts a write, so this is a tension rather than a direct contradiction. It does not explain what 'masked' means for the returned rows.

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?

Three dense sentences: outcome first, accepted input modes second, exclusivity/error and scope last. Every sentence carries operational content with no filler, though the parenthetical mode list is terse enough that an agent must cross-reference the schema to disambiguate some entries.

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?

For a 9-parameter tool with all-optional inputs and an output schema, the description covers the things the schema cannot: mode exclusivity, the error on ambiguity, auth scope, and non-persistence of ad-hoc exclusions. What is missing is a pointer to discovery_count for the same criteria when row samples aren't needed, and any statement of row masking 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 each parameter is already documented; the description's added value is grouping them into mutually exclusive modes and characterizing excluded_segment_ids as an 'A minus B' subtraction, which the schema only hints at. It omits limit and fields entirely, leaving the schema to carry those. This clears the baseline but adds only moderate meaning beyond the 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 first sentence gives a specific verb and resource — 'Return up to 25 masked sample rows for audience matching criteria' — which separates it from discovery_count/discovery_crosstab/discovery_overlap by making the output (sample rows, not aggregates) explicit. It never names those siblings directly, so differentiation is inferred from the noun phrase rather than stated.

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?

The description enumerates the five mutually exclusive invocation modes (filters, segment_id, audience_id, segment_ids+set_logic, filter_groups) and states that combining them yields AMBIGUOUS_INPUT, which is strong how-to-invoke guidance. It does not say when to prefer this over discovery_count or discovery_overlap for the same criteria, so the when-to-use half is left implicit.

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