Skip to main content
Glama

query

Answer natural-language questions against a sourced particle store with tag, date, predicate, and confidence filters, returning cited answers or deterministic claim counts and groupings.

Instructions

Run a tag-aware semantic query against the particle store.

Args:
    question: Natural-language question. Optional since: omit it
        and set structural claim filters (or an aggregate / the predicate
        listing) for the deterministic modes — no embedding, no LLM call.
    tags: Subtree-expanded tag filters, repeatable.
    subject_id: Restrict to particles about this subject.
    min_confidence: Minimum confidence value (0.0–1.0).
    top_k: Number of particles to retrieve, which the answer reads (1 to
        200). Default: the server's ``query.default_top_k`` (40).
    audience: "GENERAL" | "EXPERT" | "REGULATORY".
    summary: Deprecated alias of ``detail``: ``True`` means
        ``"summary"`` and ``False`` means ``"full"``. ``detail`` wins
        when both are given.
    detail: The shape of the result. ``"compact"`` (the
        server default, ``mcp.query_detail``) lists slim hits and drops
        every null, empty, zero or false key: a key that is absent is
        unset. ``"summary"`` is the older slim shape. ``"full"`` returns
        the whole ``QueryResponse`` with full particle records.
    hits: The most hits the result lists (0 or more). Default: under
        ``"compact"`` the server's ``mcp.query_hits`` (10); under
        ``"summary"`` and ``"full"`` every retrieved hit. The answer still
        reads all ``top_k`` hits; ``hits=0`` returns the answer and its
        disclosures only.
    as_of: ISO-8601 past instant (a bare date means start of that
        day, UTC): answer what the store believed at T.
        Retired hits carry an ``as_of_notes`` entry (current status,
        retirement instant + basis, and the superseding belief);
        ``as_of_excluded_undatable`` discloses retirements the store
        cannot date. A future instant is rejected.
    during_start: With ``during_end``, a window of world time (ISO-8601
        dates, inclusive; either may be omitted for an open end): answer
        about what began in, or was in force during, that period.
        The window prefilters the candidate set before ranking;
        with no question it returns the claims in date order, each with a
        ``window_hits`` reading (``BEGAN``, ``IN_FORCE``, ``HELD_AT``,
        ``WITHIN``). A retired claim is admitted for the period it held,
        marked with its retirement and its close. Reads ``valid_from``;
        ``window_coverage`` discloses the undated and unkinded claims the
        window could not judge. Resolve the anchor first ("when did the
        user move?"), then ask with dates: the anchor step is the caller's.
    during_end: The inclusive end date of the window; see ``during_start``.
    on: The point form: what held or happened on this date (ISO-8601).
        Alternative to ``during_start`` / ``during_end``.
    predicate: Structural filter — claims whose predicate term
        equals this string (case-insensitive, exact: a CURIE and its
        expanded IRI are different strings; discover terms with
        ``list_predicates``). With a question it prefilters the semantic
        candidate set; without one it selects the deterministic listing.
    object_eq: Claims whose object equals this value (typed comparison
        when both sides normalize — numbers and ISO dates — else
        case-insensitive text).
    object_gt: Claims whose object is greater than this number or ISO
        date; claims whose object would not normalize are excluded and
        disclosed in ``claim_coverage.not_normalizable_excluded``.
    object_lt: Claims whose object is less than this number or ISO date
        (same normalization and disclosure as ``object_gt``).
    object_contains: Claims whose object contains this substring
        (case-insensitive; every term kind).
    count: Deterministic aggregate — the number of matching claims with
        their effective-confidence distribution. Rejects a simultaneous
        question.
    group_by: Deterministic aggregate — bucket matching claims by
        "subject", "predicate", or "object" with per-bucket counts and
        confidence distribution. Rejects a simultaneous question.
    min_effective_confidence: Explicit confidence floor for the aggregate
        modes; excluded rows are disclosed. There is no default floor.
    list_predicates: List the distinct predicate terms with kind and
        claim count (``predicate_vocabulary`` in the response) — the
        discovery surface for the exact-string predicate filter.
    all_projects: On a server bound to one project, read the whole
        store instead of that project's view. The result says so. No effect
        on an unbound server.
    grounded: Compose a grounded answer: every sentence ends
        with the ids of the retrieved particles it rests on (``[p-1a2b3c4d]``,
        the form ``particle_show`` accepts), or with ``[inference]`` (the
        model's own inference over cited claims) or ``[background]`` (from
        nothing in the store). Cited ids are checked against the retrieved
        set; a sentence with no valid citation and no label is
        ``[unattributed]``. Nothing is dropped and nothing is stored.
        ``answer_attribution`` carries the per-sentence labels and full
        cited ids. Omit to use the server's ``query.grounded_answers``.
    include_refused_candidates: When the answer refuses (the store holds
        nothing relevant), the nearest beliefs are withheld by default:
        they are likely unrelated, and listing them costs the
        caller's context. ``withheld_candidates`` then says how many were
        withheld. Set ``True`` to receive them anyway, still marked by
        ``answer_refused``. No effect when the answer did not refuse.

Returns:
    By default (``detail="compact"``) the answer, its disclosures, and the
    hits the answer cites, in the order it first cites them: the facts the
    answer rests on. The answer is composed grounded for this, and its
    citation tags are removed from the text. When the answer cites nothing
    (all inference, a failed answer, ``grounded=False``) the top ``hits``
    ranked hits are listed instead. Each compact hit carries ``id`` (for
    ``particle_show``), ``content``, ``effective_confidence``, ``source``
    (the source type, URI and publication date of its first source, with
    ``(+N more)`` when it has several), ``valid_from``, and, when the claim
    is contested, ``contested`` (the open conflict's id, which
    ``particle_show`` opens) and ``contested_bases``. A listing without a
    question adds ``predicate`` and ``object``. ``hits_omitted`` counts the
    retrieved hits the answer read that the list leaves out; ask with
    ``detail="full"`` and a larger ``hits`` to see them.
    ``sources_unavailable`` means the engine sent no source lines.
    ``coverage_gaps_count`` counts the corpus entries anywhere in the store
    still PENDING or FAILED extraction (not scoped to the question); their
    ids are under ``coverage_gaps`` with ``detail="full"``. When
    the answer refuses, nothing is listed and ``withheld_candidates`` says
    how many were withheld.

    With ``detail="full"``: the full ``QueryResponse`` as JSON, answer
    string plus the ranked particles, effective
    confidences, coverage gaps, and any truncation warning. A structural
    call returns rows
    or counts, not generated prose: the deterministic listing fills
    ``particles`` ordered by effective confidence, the aggregates fill
    ``structural_aggregate``, the vocabulary listing fills
    ``predicate_vocabulary``, and every structural result carries
    ``claim_coverage`` (the annotated-fraction footer plus the
    non-normalizable exclusion disclosure). Each particle's ``contested`` key is
    the id of an open INCONSISTENCY referencing it,
    else null; the composed contested badge rides
    beside it — the response-level ``contested`` list carries one
    badge (fired bases + drill-downs) or null per ranked particle,
    and with ``summary=True`` each slim hit carries
    ``contested_bases`` (the fired basis labels, else null) beside
    its ``contested`` id. When ``summary=True``, each particle
    entry is a small dict instead of the full Pydantic model.

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": "query"
  }
}

Input Schema

NameRequiredDescriptionDefault
onNo
hitsNo
tagsNo
as_ofNo
countNo
top_kNo
detailNo
summaryNo
audienceNoGENERAL
groundedNo
group_byNo
questionNo
object_eqNo
object_gtNo
object_ltNo
predicateNo
during_endNo
subject_idNo
all_projectsNo
during_startNo
min_confidenceNo
list_predicatesNo
object_containsNo
min_effective_confidenceNo
include_refused_candidatesNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv1.263.7
    • addedInput schema / properties / detail
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "compact",
      +        "summary",
      +        "full"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Detail"
      +}
    • addedInput schema / properties / hits
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Hits"
      +}
    • addedInput schema / properties / include_refused_candidates
      Added value: +{
      +  "default": false,
      +  "title": "Include Refused Candidates",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / summary / anyOf
      Added value: +[
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / summary / default
      Previous value: -falseNew value: +null
    • removedInput schema / properties / summary / type
      Removed value: -"boolean"
    • addedInput schema / properties / top_k / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / top_k / default
      Previous value: -40New value: +null
    • removedInput schema / properties / top_k / type
      Removed value: -"integer"
  2. First observedv1.210.2

TDQS

A4/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so richly: it discloses refusal behavior and withheld candidates, context cost of listing them, grounded citation enforcement ([inference]/[background]/[unattributed]), as_of retirement disclosure, window coverage gaps, contested-claim handling, and project-binding effects. These are behavioral traits an agent could not infer from the schema alone.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Args/Returns structure is present, but the text is a very long wall that repeats itself — grounded and detail semantics are explained in both Args and the Returns section, and the Returns section restates much of what the output schema already provides. Given 25 parameters some length is justified, but the redundancy and density cost readability.

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 25-parameter, no-annotation tool with an output schema present, the description is thorough enough to invoke correctly, including temporal windows, grounding, and refusal paths. Its main remaining gap is cross-sibling routing, and the extended Returns block partially duplicates the schema it already has.

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 0%, so the description must compensate — and it does, documenting every one of the 25 parameters with formats, defaults, and modes, which is the saving grace. However, at this volume the prose is dense enough that an agent must parse paragraphs rather than read crisp per-parameter semantics; it is compensating well but not cleanly, so it sits above the low-coverage baseline without being a model of parameter clarity.

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 states a specific verb and resource — 'Run a tag-aware semantic query against the particle store' — which tells the agent exactly what the tool does. It distinguishes its semantic and deterministic modes internally, but it never explicitly separates itself from siblings like particle_search or particles_list, so an agent must infer the boundary.

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?

Strong internal guidance: it explains that omitting the question and setting structural filters gives a deterministic, no-LLM path, that list_predicates is the discovery surface for exact predicate strings, and that the temporal anchor must be resolved by the caller before asking with dates. What is missing is routing guidance against the many sibling query tools, which leaves cross-tool selection to inference.

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