Roam Research

roam_datomic_query

Execute a custom Datomic query on the Roam graph beyond the available search tools. This provides direct access to Roam's query engine for advanced data retrieval. Note: Roam graph is case-sensitive. List of some of Roam's data model Namespaces and Attributes: ancestor (descendants), attrs (lookup), block (children, heading, open, order, page, parents, props, refs, string, text-align, uid), children (view-type), create (email, time), descendant (ancestors), edit (email, seen-by, time), entity (attrs), log (id), node (title), page (uid, title), refs (text). Predicates (clojure.string/includes?, clojure.string/starts-with?, clojure.string/ends-with?, <, >, <=, >=, =, not=, !=). Aggregates (distinct, count, sum, max, min, avg, limit). Tips: Use :block/parents for all ancestor levels, :block/children for direct descendants only; combine clojure.string for complex matching, use distinct to deduplicate, leverage Pull patterns for hierarchies, handle case-sensitivity carefully, and chain ancestry rules for multi-level queries.

Input Schema

NameRequiredDescriptionDefault
inputsNoOptional array of input parameters for the query
queryYesThe Datomic query to execute (in Datalog syntax)

Input Schema (JSON Schema)

{ "properties": { "inputs": { "description": "Optional array of input parameters for the query", "items": { "type": "string" }, "type": "array" }, "query": { "description": "The Datomic query to execute (in Datalog syntax)", "type": "string" } }, "required": [ "query" ], "type": "object" }