Skip to main content
Glama

Flecs Explain Query

flecs_explain_query
Read-onlyIdempotent

Explain how FLECS parses and plans a query without returning results, revealing resolved terms, field schema, and query plan to debug queries that match nothing or too much.

Instructions

[READ] Explain how FLECS parses and plans a query, without returning results.

Returns 'query_info' (resolved terms: operator, source, traversal flags), 'field_info' (id, type and member schema per field), 'query_plan' (the FLECS query plan as text) and optionally 'query_profile'. Use it to debug queries that match nothing or match too much. Invalid queries return the FLECS parser error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesQuery in the FLECS query language, e.g. 'Position, Velocity'.
profileNoAlso measure evaluation time and result/entity counts ('query_profile'). Evaluates the query repeatedly for up to ~1 ms.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint/non-destructive, so the safety profile is covered and the description needn't restate it. It adds genuine behavior beyond that: no results are returned, structured debug sections are produced, and invalid queries surface the FLECS parser error rather than failing opaquely.

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

Conciseness5/5

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

The purpose and the 'no results' constraint are front-loaded, followed by the returned sections and then the debugging use case. Four short sentences, each carrying distinct information with no redundancy.

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?

With an output schema present, the description need not explain return shapes, yet it still names the key sections and the optional profile. Purpose, usage trigger, result structure, and error behavior are all covered, leaving nothing an agent needs missing.

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 both 'query' and 'profile' are already fully documented in the schema, including the ~1 ms repeated-evaluation behavior. The description only echoes the optional 'query_profile' output, adding no syntax or format detail beyond the schema, so the baseline 3 applies.

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 description states a specific verb and resource ('Explain how FLECS parses and plans a query') and immediately scopes it ('without returning results'), which cleanly separates it from the sibling flecs_query that presumably executes queries. An agent can identify the tool's role without opening any 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?

'Use it to debug queries that match nothing or match too much' gives a concrete condition for reaching for this tool. It stops short of naming the alternative (e.g. flecs_query) or stating when not to use it, so it is clear context without explicit exclusions.

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