Skip to main content
Glama

brain_brain_query

Primary tool for pattern-based operations on TheBrain. Requires npub for credit billing.

Accepts BrainQuery (BQL) -- a Cypher subset supporting MATCH, WHERE, CREATE, SET, MERGE, DELETE, and RETURN.

⚠️ Name-based matching (MATCH by name, WHERE CONTAINS/STARTS WITH/=~) resolves through the vendor's search/name index, which is incomplete on large brains (TheBrainTech/thebrain-api-quickstart-python#1): a query may fail to match a thought that provably exists. An empty match set is NOT proof of absence — do not CREATE/MERGE a node on the assumption it is missing without an ID-based check (get_thought). Matching by ID is reliable; matching by name inherits the index's blind spots.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
npubNoRequired. Your Nostr public key (npub1...) for credit billing.
queryYesA BrainQuery string (Cypher subset).
confirmNoSet to true to confirm and execute a DELETE operation.
brain_idNoThe ID of the brain (uses active brain if not specified)
dpop_tokenNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations provided, the description fully discloses critical behaviors: incomplete name index can cause false negatives, empty match sets don't prove absence, and ID matching is reliable. It also warns against unsafe CREATE/MERGE without ID verification, and supports a limited Cypher subset.

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 moderately lengthy but well-structured, front-loading the purpose and credit billing requirement, then detailing syntax and important limitations/warnings. Each sentence adds value, though the warning could be slightly more concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex tool with write/delete capabilities, the description covers billing, syntax, safety caveats, and confirmation for DELETE. An output schema exists, so return values need not be described. It lacks details on dpop_token or transaction behavior, but is otherwise thorough.

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 80%, but the description enriches the 'query' parameter by explaining BQL syntax and the unreliability of name matching. It adds meaningful context beyond the schema, though other parameters like dpop_token remain undocumented.

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 clearly identifies the tool as the 'Primary tool for pattern-based operations on TheBrain' and specifies it accepts BrainQuery (BQL), a Cypher subset. This distinguishes it from sibling CRUD tools by emphasizing general pattern-based operations.

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?

Provides explicit guidance on when not to rely on name-based matching and recommends using get_thought for ID-based checks to avoid erroneous CREATE/MERGE. Also notes the billing requirement (npub). However, it does not directly compare use cases with most sibling tools.

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.

TDQS

B3.3/5.0
Disambiguation2/5

Multiple tools have overlapping purposes. For example, `brain_request_credential_channel` and `brain_request_patron_credentials` serve similar roles, and `brain_receive_credentials`, `brain_receive_npub_proof`, and `brain_receive_patron_credentials` all handle receiving data from a courier flow. While descriptions help, the sheer number of tools (83) with similar-sounding purposes (check_ vs get_ vs request_ vs receive_ prefixes) makes it hard to quickly distinguish which tool to use.

Naming Consistency3/5

The tools mostly follow a `brain_verb_noun` pattern (e.g., `brain_create_thought`, `brain_delete_link`), which provides some consistency. However, there are inconsistencies with prefixes like `brain_oracle_` (e.g., `brain_oracle_about`, `brain_oracle_how_to_join`) which are more like static pages than actions. Additionally, 'check' and 'get' seem interchangeable (e.g., `brain_check_balance` vs `brain_get_thought`), and 'list' is used alongside 'get' in a way that sometimes means the same thing (e.g., `brain_list_brains` vs `brain_get_brain`).

Tool Count2/5

83 tools is an extremely large and unwieldy surface area. While the server aims to be a comprehensive 'operating system' for a specific ecosystem (DPYC/Nostr), this many tools will lead to agent confusion and high latency. Tools like `brain_oracle_about`, `brain_oracle_how_to_join`, and `brain_oracle_network_advisory` could easily be combined into a single tool or served as function parameters.

Completeness4/5

For its stated domain (managing a 'brain' with credits, payments, and Nostr integration), the tool set is remarkably complete. It covers CRUD operations, payment flows (purchase, check, restore), coupon management, credential handling, and even notarization. Minor gaps are hard to identify, though some flows feel overly complex (e.g., the multiple `request_`/`receive_` patterns could arguably be simplified). The high number of tools is a result of this extreme specialization.