combine_queries
Boolean set algebra over the results of two or more VFB queries, compared on term ID. USE THIS INSTEAD OF RUNNING THE QUERIES SEPARATELY AND INTERSECTING THEM YOURSELF — the operands are often hundreds or thousands of rows each, so doing it by hand is both slow and a common source of wrong answers. Answers questions of the form "which neurons are in both X and Y", "in X but not Y", "in either but not both". Operators: AND OR NOT XOR NAND NOR XNOR, unary NOT, brackets, symbol aliases (& | - ^) and plain-English aliases ("but not", "in both", "either but not both"). Precedence loosest-first: OR/NOR, then XOR/XNOR, then AND/NAND/NOT, all left-associative. The response explains itself — as_read gives the grouping actually parsed, plain_english reads the whole expression back, steps traces the size of every intermediate set, and warnings flag the three ways a combination is silently wrong (a truncated operand, two sides in different ID namespaces, a complement against an implicit universe). ALWAYS CHECK as_read AGAINST WHAT THE USER ASKED before reporting the answer; use explain_only=true to see the parse for free before spending a query. Query-type operands must name a real query_type — get it from get_term_info's Queries array for the term in question, exactly as for run_query.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"expr": "<expr>",
"operands": "<operands>"
},
"name": "combine_queries"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expr | Yes | The boolean expression over your operand names, e.g. "calyx AND lh", "calyx but not lh", "(a OR b) AND NOT c". Max 2000 characters. | |
| limit | No | Rows to return (default 25). count is always the true size of the result set. There is no offset — raise limit, or pass 0 for every row, only on a result you already know is small. | |
| operands | Yes | Named sets referenced by expr. Each value takes one of three forms: "<QueryType>:<id>" to run a query (e.g. "NeuronsPartHere:FBbt_00007401" — any run_query query_type), "search:<text>" for a free-text search, or "ids:<id>,<id>" for a literal set (useful for a list from a paper or the ids of a previous combine). Max 12 operands. | |
| universe | No | Optional operand spec, same three forms, defining what "everything" means for a complement (NOT, NAND, NOR, XNOR). Defaults to the union of the operands in the expression, because VFB holds around 750,000 terms and returning most of them is never the intended answer. | |
| explain_only | No | Parse and explain the expression without running any query (default false). Returns as_read, plain_english and the universe note in well under a kilobyte. Use it to confirm the grouping of anything more complicated than a single operator before spending real work. | |
| include_images | No | Include the thumbnail column (default false — it is stripped to save space; on a 220-row result it is the difference between 428 KB and 9.5 KB). | |
| require_complete | No | Fail rather than answer if any operand was truncated (default false). A set operation over a truncated operand is silently wrong, so set this when the answer matters more than getting one. |