Skip to main content
Glama
localseodata

Local SEO Data

Official

ai_sample

Read-only

Samples the same prompt multiple times to measure how often each business appears in AI answers, providing a visibility rate rather than a one-off result.

Instructions

Use when measuring HOW OFTEN an AI answer names a business, not just whether it did once. Read-only: it asks the same question samples times and reports how often each business appears; nothing is changed or posted anywhere. The runs take one to three minutes, longer than a tool call can wait, so this returns a job_id right away -- call ai_sample_status with it to get the result.

COLLECTING: ai_sample_status is free and the result does not expire. Typical answers are ready in 30-60 seconds and the slowest in about 130 -- wait 30 seconds before the first check and roughly 15 between checks. status is "pending" or "running" until then.

WHY SAMPLE: a model composes its answer per request, so one answer is a sample, not a fact -- ask twice ten minutes apart and the businesses and their order can differ. A client asking "am I showing up in AI answers?" is asking for a rate, which a single ai_scraper or ai_mode call cannot give.

REPEATS: an identical request within 10 minutes returns the run already in progress (deduplicated: true, 0 credits), so retrying after a dropped connection is safe. To measure the same prompt again on purpose, pass force_new: true. Pass idempotency_key to group requests yourself.

PLATFORMS: chat_gpt and gemini cost 4 credits per sample; google_ai_mode costs 2 credits per sample and requires a location. The mention and visibility tools read stored aggregates, so they are not sampleable -- running one ten times returns the same numbers ten times.

COST: samples x the per-run price; 10 samples on chat_gpt is 40 credits. Samples that never complete are refunded, and the final figure is credits_charged on the status response.

Input Schema

NameRequiredDescriptionDefault
keywordYesThe prompt or keyword to ask repeatedly (e.g. "best plumber in Orchard Park NY")
samplesYesHow many times to run the prompt, 2-25. Below about 5 the rate is too coarse to act on; 10 is the usual daily figure.
languageNoLanguage to ask in, as ISO 639-1 code or name (e.g. "fr", "French"). Defaults to the language of the market you pass.
locationNoLocation (e.g. "Orchard Park, NY"). Required on google_ai_mode. Gemini supports city-level; ChatGPT resolves to country.
platformYesWhich generator to sample. google_ai_mode is Google AI Mode and requires a location.
force_newNoRun the prompt again even though an identical submit is within the 10-minute replay window. This is how you take a SECOND measurement of the same prompt on purpose; without it the repeat is treated as a retry and returns the first job.
idempotency_keyNoYour own key for this submit. Two submits carrying the same key return the same job for 24 hours, whatever their parameters. Use it when you are driving runs from a schedule and want the grouping to be yours rather than ours.
force_web_searchNoRequire the platform to search the web before answering. chat_gpt only. Use it when a local prompt comes back as a clarifying question rather than an answer.

Output Schema

NameRequiredDescriptionDefault
job_idYes
statusYes
poll_urlYes
deduplicatedNo
estimated_secondsYes
samples_requestedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare read-only and open-world, and the description still adds substantial operational context beyond them: the call is asynchronous, returns a job_id immediately, costs 1-3 minutes, typical completion is 30-60s with a 130s worst case, deduplication replays identical requests within 10 minutes at 0 credits, and incomplete samples are refunded with credits_charged as the final figure. That is exactly the behavioral payload annotations cannot express.

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 lead sentence front-loads the decision criterion, and the labeled sections (COLLECTING, WHY SAMPLE, REPEATS, PLATFORMS, COST) make it scannable. It runs long for a tool description and repeats the dedup window in both REPEATS and the force_new schema text, so a sentence or two could be trimmed.

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

Completeness5/5

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

For an asynchronous, credit-consuming tool with an output schema, the description supplies everything an agent needs to call it and act on it: the polling cadence against ai_sample_status, cost math before spending credits, refund behavior, and dedup semantics for safe retries. Nothing material is left to inference.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds cross-parameter economics (samples x per-run price, 4 credits on chat_gpt vs 2 on google_ai_mode, location required for google_ai_mode) and the reasoning behind force_new and idempotency_key rather than restating their schema text. The extra value is real but partly duplicative of the schema wording.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific use condition — measuring HOW OFTEN an AI answer names a business, explicitly contrasted with a single-answer tool — and names both the resource sampled and the job-based return shape. It also distinguishes itself from siblings (ai_scraper, ai_mode, mention/visibility tools) so the agent can route correctly without opening a schema.

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

Usage Guidelines5/5

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

The 'WHY SAMPLE' section states exactly when this tool is right (a client asking for a rate) and when it is not (mention and visibility tools read stored aggregates, so running them repeatedly returns identical numbers). It also names the follow-up tool (ai_sample_status) and the overrides (force_new, idempotency_key) with the condition that selects each.

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