Skip to main content
Glama

Flecs List Queries

flecs_list_queries
Read-onlyIdempotent

List named queries, systems, and observers with evaluation counts and timing, filterable by kind or name. Use to inspect FLECS performance and identify query plans.

Instructions

[READ] List named queries, systems and observers with evaluation statistics.

Each entry has 'name' (usable with flecs_run_named_query), 'kind' (Query, System or Observer), 'expr' (the query expression), 'results' and 'count' (current matches), 'eval_count', 'eval_time', 'eval_mode', 'cache_kind', 'batched', 'empty_tables', 'plan_size' and, when the stats module is imported, 'memory'. FLECS evaluates every query to produce this list, which can take a while in very large worlds. Returns {total, offset, limit, queries}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindNoOnly return entries of this kind.
limitNoMaximum number of items to return.
offsetNoNumber of items to skip (for paging).
include_plansNoInclude the query plan text ('plan', 'cache_plan').
name_containsNoOnly return entries whose name contains this text (any case).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitYes
totalYes
offsetYes
queriesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds genuinely new behavior: every query is evaluated to build the list (a real performance cost), and the 'memory' field appears only when the stats module is imported. That is useful operational context beyond the structured hints.

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?

Front-loads the purpose and the [READ] tag, then enumerates fields efficiently. The field-by-field enumeration is somewhat redundant given an output schema exists, but the cross-reference and cost caveat justify most of the length.

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 a paginated listing tool with a full output schema, it covers what the schema cannot: the evaluation cost, the conditional stats-module field, and the downstream link to flecs_run_named_query. An agent has everything needed to call it correctly and interpret the result.

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 the schema already documents kind, limit, offset, include_plans and name_contains. The description adds no parameter-level syntax or filtering guidance, so the baseline 3 applies; it earns no extra credit here.

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?

States a specific verb and resource ('List named queries, systems and observers') and names the exact scope of the results (evaluation statistics). It even ties the returned 'name' field back to the sibling flecs_run_named_query, so an agent can distinguish this discovery tool from the execution tool without opening either 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?

Gives clear context: use this to discover named queries/systems/observers whose names feed flecs_run_named_query, and warns that listing triggers full evaluation and 'can take a while in very large worlds.' It does not explicitly say when to prefer flecs_query, flecs_explain_query, or flecs_get_pipeline_stats instead, so there are no hard exclusions.

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