Skip to main content
Glama

run_query

Run a pre-computed query on a VFB entity. REQUIRED WORKFLOW: (1) call get_term_info on the ID first; (2) read the response's "Queries" array; (3) pass one of those values as query_type. Calling run_query with a guessed query_type will return an error. If a query returns empty rows or an error, the entity does not support that query_type or has no data for it — try a different query_type from the Queries array, or try a related entity (e.g. its parent class via get_hierarchy). Empty results do NOT mean the answer is unknown — only that this call did not return it. NEVER fabricate results from training data when a query is empty; tell the user clearly what was tried. NEVER pass tool names like "get_term_info" or "search_terms" as query_type — those are separate tools. Common query_types by entity kind: PaintedDomains, AllAlignedImages, AlignedDatasets, AllDatasets (templates); SimilarMorphologyTo, NeuronInputsTo, NeuronNeuronConnectivityQuery, NeuronRegionConnectivityQuery (individual neurons); ListAllAvailableImages, SubclassesOf, PartsOf, NeuronsPartHere, NeuronsSynaptic, ExpressionOverlapsHere, DownstreamClassConnectivity, UpstreamClassConnectivity (classes). Supports batch — pass an array of IDs (same query_type) or a "queries" array of {id, query_type} pairs; batch results are keyed by "ID::query_type". Results are PAGED: the first 25 rows by default (change with limit/offset) plus the true total as "count". ALWAYS read "count_status" before quoting "count": "exact" means count is the true total; "unavailable" means the query FAILED upstream and count is -1, which is NOT zero and must never be reported as "no results" — read "_note" and tell the user the query could not be run. Image/thumbnail columns are excluded by default to save space - pass include_images=true to include them. FlyBase integration is via query_types too: FindStocks (fly stocks for a FlyBase feature ID - FBgn/FBal/FBti/FBtp/FBco/FBst; for an FBco split combination only the best tier is returned, labelled in a "match" column: Exact combination, else per hemidriver Hemidriver alone, else Hemidriver in other combination) and FindComboPublications (publications for an FBco split-GAL4 combination). Get those IDs from resolve_entity / resolve_combination first, then run_query with the ID and the query_type. Include FlyBase links in output: https://flybase.org/reports/{ID}.

Input Schema

NameRequiredDescriptionDefault
idNoOne or more VFB IDs to query
limitNoMax rows returned per call (default 25). The true total is always returned as "count"; broad queries (e.g. ListAllAvailableImages, or NeuronsSynaptic on a whole region) can have thousands to hundreds of thousands of rows. Use 0 for all rows (still capped server-side ~25000 - avoid for broad queries).
offsetNoRow offset for paging (default 0). To get the next page, re-run with offset increased by limit; "count" gives the total.
queriesNoArray of {id, query_type} pairs for mixed batch queries. When provided, id and query_type params are ignored.
query_typeNoA valid query type from the Queries array returned by get_term_info. Used for single id or array of ids.
force_refreshNoBypass the response cache and recompute this result. Expensive — leave it unset on a first call. Set it ONLY to re-try a call that, earlier in this same conversation, returned a result that was clearly wrong, stale, or reported as failed. Never set it on more than one retry of the same call. A failed query (count -1) is already retried once automatically, so you do not need this for that case.
include_imagesNoInclude the image/thumbnail column in result rows. Default false: the thumbnail is a long markdown image string that is rarely useful to reason over and greatly inflates every row, so it is stripped and the response says so in _note. Set true to include it (e.g. to build image URLs).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / force_refresh
      Added value: +{
      +  "description": "Bypass the response cache and recompute this result. Expensive — leave it unset on a first call. Set it ONLY to re-try a call that, earlier in this same conversation, returned a result that was clearly wrong, stale, or reported as failed. Never set it on more than one retry of the same call. A failed query (count -1) is already retried once automatically, so you do not need this for that case.",
      +  "type": "boolean"
      +}
  2. Changed3 schema fields changed
    • addedInput schema / properties / include_images
      Added value: +{
      +  "description": "Include the image/thumbnail column in result rows. Default false: the thumbnail is a long markdown image string that is rarely useful to reason over and greatly inflates every row, so it is stripped and the response says so in _note. Set true to include it (e.g. to build image URLs).",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "description": "Max rows returned per call (default 25). The true total is always returned as \"count\"; broad queries (e.g. ListAllAvailableImages, or NeuronsSynaptic on a whole region) can have thousands to hundreds of thousands of rows. Use 0 for all rows (still capped server-side ~25000 - avoid for broad queries).",
      +  "type": "number"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "description": "Row offset for paging (default 0). To get the next page, re-run with offset increased by limit; \"count\" gives the total.",
      +  "type": "number"
      +}
  3. Changed6 schema fields changed
    • changedInput schema / properties / id / description
      Previous value: -"VFB ID (e.g., VFB_00101567)"New value: +"One or more VFB IDs to query"
    • addedInput schema / properties / id / oneOf
      Added value: +[
      +  {
      +    "description": "A single VFB ID (e.g., VFB_00101567)",
      +    "type": "string"
      +  },
      +  {
      +    "description": "An array of VFB IDs — all will use the same query_type",
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +]
    • removedInput schema / properties / id / type
      Removed value: -"string"
    • addedInput schema / properties / queries
      Added value: +{
      +  "description": "Array of {id, query_type} pairs for mixed batch queries. When provided, id and query_type params are ignored.",
      +  "items": {
      +    "properties": {
      +      "id": {
      +        "description": "VFB ID",
      +        "type": "string"
      +      },
      +      "query_type": {
      +        "description": "Query type for this ID",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "query_type"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / query_type / description
      Previous value: -"A valid query type from the Queries array returned by get_term_info (e.g., PaintedDomains, AllAlignedImages, SubclassesOf). Do NOT use tool names here. Always check get_term_info first for available query types."New value: +"A valid query type from the Queries array returned by get_term_info. Used for single id or array of ids."
    • removedInput schema / required
      Removed value: -[
      -  "id",
      -  "query_type"
      -]
  4. Changed1 schema field changed
    • changedInput schema / properties / query_type / description
      Previous value: -"A valid query type from the Queries array returned by get_term_info (e.g., PaintedDomains, AllAlignedImages, SubclassesOf). Do NOT use tool names here."New value: +"A valid query type from the Queries array returned by get_term_info (e.g., PaintedDomains, AllAlignedImages, SubclassesOf). Do NOT use tool names here. Always check get_term_info first for available query types."
  5. Changed1 schema field changed
    • changedInput schema / properties / query_type / description
      Previous value: -"Query type (e.g., PaintedDomains)"New value: +"A valid query type from the Queries array returned by get_term_info (e.g., PaintedDomains, AllAlignedImages, SubclassesOf). Do NOT use tool names here."
  6. First observed

TDQS

A4.8/5.0
Behavior5/5

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

No annotations exist, so the description must carry the full load, and it does: default paging of 25 rows with true total in 'count', the 'count_status' exact/unavailable distinction (count -1 is a failed query, not zero), automatic single retry on failure, cache bypass semantics and retry limits for force_refresh, default stripping of image columns, and batch result keying by 'ID::query_type'. It also warns against fabricating results from training data — behavior an agent would otherwise not know.

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 critical prerequisite workflow is front-loaded in the first sentences, which is the right ordering, and each block (workflow, query_type catalogue, batch, paging, count_status, images, FlyBase) is distinct. It is long and the FlyBase paragraph is dense, but for a 7-parameter multi-mode tool most sentences earn their place.

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 7 optional parameters, no output schema, no annotations, and batch plus FlyBase modes, the description covers the prerequisite discovery step, valid inputs, paging, error and empty-result interpretation, and ID resolution for FlyBase. An agent has everything needed to invoke it correctly and to interpret the response without an output schema.

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; the description still adds real value by enumerating common query_type values grouped by entity kind (templates, individual neurons, classes) and by explaining batch keying and the FlyBase query_types with their ID prefixes. The limit/offset/force_refresh/include_images semantics largely restate what the schema already documents.

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 ('Run a pre-computed query on a VFB entity') and immediately differentiates from siblings by naming get_term_info, search_terms, get_hierarchy, resolve_entity and resolve_combination as separate tools that are not query_types. An agent can tell what this tool does and what it does not do.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

Gives an explicit numbered workflow (call get_term_info, read the Queries array, pass a value as query_type) plus an explicit negative rule (never guess a query_type, never pass tool names as query_type) and named fallbacks (get_hierarchy for a parent class, resolve_entity/resolve_combination for FlyBase IDs). Empty/failed-result handling is spelled out with what to try next.

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.