Skip to main content
Glama

Query search runs

query_search_runs
Read-only

To see the people or companies one run found, pass its id to list_people or list_companies as a {"column_key": "run", "operator": "is_any_of", "values": [run ids as strings]} filter, for the people or companies it found still on the agent, or to query_search_results as run_id, for the rows of the people or companies it found on the list it saved to (none for a 'user_added' run, which saves to no list). All of them include the rejected ones. A dict with runs and total, the number of matching runs; page with offset += limit while offset + limit < total. Each run carries id; source, the discovery tool as the source column of query_search_results names it, or 'user_added' for people the user added; entity_type, 'person' or 'company', what it looks for, set even when it found no one; arguments, what the run was called with (for a Websets run, its list's search settings) and, unless the run's source is 'user_added', list_name, the list it saved to, even when the call named none; started_at; finished_at, null while a Websets search is still running; found, the people or companies it returned, ones the agent already had included; matched and filtered_out, those whose row in the list the run saved to is qualified or rejected now (both 0 for people the user added, who get no list row); and new, those this run brought to the agent: no earlier run returned them and they weren't on the agent before it started.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "agent_id": "<agent_id>"
    },
    "name": "query_search_runs"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoRuns per page (default 50, max 200).
offsetNoRuns to skip for paging (default 0).
agent_idYesThe agent whose search runs to list.
person_idNoOnly the runs that found this person (the person `id` list_people returns).
company_idNoOnly the runs that found this company (the company `id` list_companies returns, or a row's `company_profile_id`).
entity_typeNoOnly the runs that look for people ('person') or for companies ('company'); omit for both.
on_behalf_ofNoA teammate's email, or an agency client's from list_agency_clients, to run this call in that account: their agents, settings, connected accounts, and credits. Omit it to act on your own account.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / on_behalf_of / description
      Previous value: -"An agency client's email, from list_agency_clients, to run this call in that client's account: their agents, settings, connected accounts, and credits. Omit it to act on your own account."New value: +"A teammate's email, or an agency client's from list_agency_clients, to run this call in that account: their agents, settings, connected accounts, and credits. Omit it to act on your own account."
  2. Changed2 schema fields changed
    • changedInput schema / properties / company_id / description
      Previous value: -"Only the runs that found this company (the company `id` query_agent_companies\nreturns, or a row's `company_profile_id`)."New value: +"Only the runs that found this company (the company `id` list_companies\nreturns, or a row's `company_profile_id`)."
    • changedInput schema / properties / person_id / description
      Previous value: -"Only the runs that found this person (the person `id` query_agent_people\nreturns)."New value: +"Only the runs that found this person (the person `id` list_people\nreturns)."
  3. Changed1 schema field changed
    • changedInput schema / properties / company_id / description
      Previous value: -"Only the runs that found this company (a row's `company_profile_id`)."New value: +"Only the runs that found this company (the company `id` query_agent_companies\nreturns, or a row's `company_profile_id`)."
  4. Changed2 schema fields changed
    • changedInput schema / properties / entity_type / anyOf
      Previous value: -[
      -  {
      -    "enum": [
      -      "person",
      -      "company"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "person",
      +      "company"
      +    ],
      +    "title": "EntityType",
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / on_behalf_of
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "An agency client's email, from list_agency_clients, to run this call in that client's account: their agents, settings, connected accounts, and credits. Omit it to act on your own account."
      +}
  5. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnlyHint, so the description carries most of the behavioral load and does so: ordering, paging loop (offset += limit while offset + limit < total), the null finished_at meaning a Websets search is still in flight, that 'found' includes people the agent already had, that 'matched'/'filtered_out' reflect current list row state, that both are 0 for user_added runs, and the precise definition of 'new'. These are non-obvious semantics an agent could not infer elsewhere.

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?

Purpose is front-loaded in the first sentence and no sentence is filler — the dense returns material earns its space because there is no output schema. The cost is readability: the second paragraph is one very long run-on sentence with inline filter JSON that is hard to parse on a single pass.

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?

There is no output schema, and the <returns> block substitutes for it field by field (id, source, entity_type, arguments, list_name, started_at, finished_at, found, matched, filtered_out, new), plus a top-level shape of runs and total. Combined with readOnlyHint and a fully documented 7-parameter schema, an agent has everything needed to call this correctly.

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 real meaning on top: it explains the paging arithmetic tied to the returned total, the string-typed run ids when used as filters elsewhere, and that list_name is present unless source is 'user_added'. It says nothing about person_id/company_id/entity_type/on_behalf_of beyond what the schema already states, so it does not fully cover the parameter surface itself.

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?

The opening states a specific verb and resource (list the searches / discovery runs for an agent), fixes the ordering (newest first), and then explicitly defines what a 'run' is, including all four flavours (discovery tool call, Websets search/extend, batch user add). It also signals the relationship to siblings (list_people, list_companies, query_search_results), so an agent can distinguish it 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 Guidelines4/5

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

The description tells the agent exactly what to do with a run id — pass it to list_people or list_companies as an is_any_of filter, or to query_search_results as run_id — which is genuine routing guidance. It stops short of an explicit 'use this tool when you need X, use query_search_results when you need Y' exclusion, so the when-not is inferred rather than stated.

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