Skip to main content
Glama

query

Search the particle store by natural-language question, tags, or structural filters to retrieve ranked claims and confidences; run counts, groupings, predicate listings, and time-window lookups.

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 (1–200).
    audience: "GENERAL" | "EXPERT" | "REGULATORY".
    summary: When ``True``, each hit in ``particles`` is reduced to
        ``{id, content, confidence, effective_confidence,
        subject_ids}`` — provenance, tags, properties, and
        embeddings are dropped. The NL ``answer`` string and
        coverage gaps are unchanged. Use this when the agent only
        needs to surface the answer and pick particles to
        ``particle_show`` later. Default ``False`` preserves the
        full ``QueryResponse`` shape for backward compatibility.
    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``.

Returns:
    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.

Input Schema

NameRequiredDescriptionDefault
onNo
tagsNo
as_ofNo
countNo
top_kNo
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

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.210.2

TDQS

A4.5/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 behavioral burden and does so richly: deterministic modes use no embedding or LLM call, count/group_by reject simultaneous questions, future as_of instants are rejected, summary drops provenance/tags/properties/embeddings, grounded answers cite or label every sentence, and all_projects has no effect on an unbound server. It also discloses exclusions, coverage gaps, and retired-claim handling.

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 description is front-loaded with a clear purpose and organized into Args/Returns, which suits a 22-parameter tool. It is necessarily dense, but some return-detail text is verbose and partially duplicates the output schema, so it is not maximally concise.

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?

Given 22 parameters, 0% schema description coverage, no annotations, and an output schema, the description is complete enough to call the tool correctly. It covers every parameter, mode interactions, rejection rules, response shapes, coverage gaps, and attribution behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across 22 parameters, so the description must compensate entirely, and it does: every parameter is explained with meaning, accepted values, interactions, and defaults. Examples include predicate's exact-string/CURIE caveat, object_gt/object_lt normalization and disclosure, count/group_by rejection of question, and during_start's window semantics.

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 names a specific verb and resource: 'Run a tag-aware semantic query against the particle store.' It also explains the major operating modes (semantic question, deterministic structural listing, aggregates, predicate vocabulary, grounded answers). It does not explicitly differentiate itself from sibling tools such as particle_search, though it references particle_show for follow-up inspection.

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 gives explicit conditional guidance within the tool: omit question for deterministic modes, use summary when only answer and particle IDs are needed, use as_of for point-in-time beliefs, use during_start/during_end for windows, and notes that count/group_by reject a simultaneous question. It does not, however, say when to choose this tool over sibling search/list tools.

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