Search a room
searchSearch one Meaning-Space for evidence and graph nodes by words, a reference (2:190) or a name, to find where to start and what to cite. Input: query (required) and namespace_id (a room name from find_rooms; omitted means the default room). Returns bounded source and graph evidence, never a generated answer; a hit that records an imported graph node carries node_id: pass it to query_graph_neighbors (node_id) or query_graph_paths (source_node_id, target_node_id) to follow that node's relations. Imported graph search makes no model call, matches whole words and ranks by relevance; a reference query (2:190, 2:190-193) returns exactly those nodes in order. Without the MCP token a reader searches the imported graph only: MANAGED_MEMORY and ALL are refused with READER_SEARCH_IMPORTED_ONLY. When truncated, pass next_cursor as cursor (same query and mode) for the next page. Managed-memory search embeds the query with the server's embedding model (PROVIDER_SETUP_REQUIRED when none is configured) and ranks stored facts and evidence by keyword and similarity; every model call is billed to the operator, which is why a reader is refused it. data_mode: imported data is deterministic with no model, managed and mixed use the server's model provider, and there are no silent partial results. A query naming verse-style references (2:190, a range 2:190-193 or 2:190-2:193 within one chapter) first resolves through the nodes' reference property and returns exactly those nodes in reading order; words are searched only when no node has them. Imported hits name match_source, the field the query matched in (text_en; text_en_bracket when it matched only inside square brackets, words a translator added); exclude_brackets skips hits whose every match lies inside them (match_source ending in _bracket) and leaves the stored text unchanged. match: word (the default) requires every query word in the hit as a whole word or as a part of a hyphenated or apostrophe compound (light finds light and Allah's light, never flight or delighted), and a query word with a hyphen or apostrophe matches that whole compound (j-z-y); stem also folds the endings of the text's language: common English endings (lights, lighted, lighting find light), Arabic prefixes, pronouns and endings, and, since 4.3.2, German and Turkish endings where the property names the language (text_de, text_tr; a property with a code and no rules, text_fa, is never stemmed); substring is the containment of earlier revisions. Every mode folds the query and the stored text alike: compatibility forms, case, the optional diacritics of Latin, Greek, Cyrillic, Hebrew and Arabic (ḍ-w-ʾ is found as d-w-ʾ, ضَوْء as ضوء), the Arabic letter variants and the attached article (نور finds النور), Arabic-Indic digits, Katakana as Hiragana; a word of a script written without spaces (Chinese, Japanese, Thai) matches by containment. sort: relevance (the default) is BM25 over the hit's fields (its name weighs most; a list property such as roots is a set of values), plus the whole query as a phrase in one field and a field that is exactly the query, a word the query word starts (transgressors for transgress) counting half; ties in reading order. reference is reading order, a node's reference property in natural order (2:190 before 10:5), nodes without one after them by bundle id. node_id is by node id, the order of earlier revisions. The same request on the same generation returns the same pages; a reference query keeps its references' order. context: for each imported hit, this many nodes before and after it in reading order, returned in its context and marked CONTEXT, never counted as matches: the neighbours along the hit's sequence relation (a directed relation to nodes of its own label with at most one edge each way, such as NEXT_AYAH between ayahs), or along context_relation. verbosity: full, the default, keeps snippet as the whole record and record.properties whole. compact makes snippet the text a reader would quote (text_en, text, definition, description, summary or content, else the record's longest text, else its name; at most 1024 characters) and record.properties what names and what is quoted, in any bundle (the name, every string of at most 64 characters such as an identifier, a reference or a form, that one text, and every list of at most 32 short strings such as a verse's roots or a term's synonyms); numbers, other long texts and nested values are left to fields, which adds properties to record.properties in either verbosity (a name the record does not hold is ignored). It lists at most 5 of the focus's strongest relations per kind (its counts stay whole). linked: the nodes one relation links to each imported hit, as record.linked (name, node_id and the direction of each edge, the heaviest first), read per hit: a verse's roots (OCCURS_IN, IN, labels Root, since its lemmas occur in it by the same relation), a term's parents (IS_A, OUT), a page's sites (LINKS_TO); labels filters as query_graph_neighbors does. Example: {"query": "camphor metabolic process", "namespace_id": "obo-go"}. Since contract 4.3.0 imported search matches whole words (light never finds flight or delighted; match stem folds English endings, substring restores containment), ranks by relevance (sort relevance, the default; reference for reading order; node_id), names a root hit's match_source roots (never roots_bracket, so exclude_brackets keeps it), resolves a reference query (2:190, 2:190-193) to exactly those nodes in order, returns context nodes before and after each hit (context=N, marked CONTEXT, not matches), counts every hit (total), and on page 1 names the node the query denotes (focus: Root j-z-y with its occurrences and lemmas, a rare lemma such as jizyah located in 9:29, every place saying how, located_by EDGE, LIST, TEXT or STEM, and as what word; STEM means a word of the text inflects the member's form in the text's language, بَرْزَخًا for بَرْزَخ). Since contract revision 4.6.0 verbosity compact shapes each hit for reading (snippet the quotable text, record.properties what names and what is quoted), fields adds properties and linked the nodes one relation links to each hit, every imported hit carries record (its id, labels and properties as data), the node's own name names the focus, and focus_reason says why a focus is absent or taken among several. The contract revision in force is the one every response repeats in _meta.contract_revision and server_info reports; a revision note (Added in, Since) says when a field or a tool appeared, never which revision is current.
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": {
"query": "<query>"
},
"name": "search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | relevance, reference (reading order) or node_id. | relevance |
| limit | No | Results per page. | |
| match | No | word: whole words. stem: also the language's endings. substring: containment. | word |
| query | Yes | Words, a name or references (2:190, 2:190-193). | |
| cursor | No | next_cursor of the previous page of the same request. | |
| fields | No | Properties to add to record.properties. | |
| linked | No | Nodes one relation links to each imported hit, as record.linked. | |
| context | No | Nodes to add before and after each hit in reading order, marked CONTEXT. | |
| data_mode | No | IMPORTED_GRAPH calls no model; MANAGED_MEMORY and ALL need the MCP token. | AUTO |
| verbosity | No | full keeps the whole record; compact what names and what is quoted. | full |
| namespace_id | No | Room name; omitted: the default room. | |
| context_relation | No | Relation type context follows instead of the hit's sequence relation. | |
| exclude_brackets | No | Skip imported hits that match only inside square brackets. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | Added in contract revision 4.3.0. On pages of imported hits: the order they are listed in; reference when a reference query resolved. | |
| focus | No | Added in contract revision 4.3.0. On the first page of an imported search: the node the query names exactly (a property other than its name is the query and its name holds it, as Root j-z-y for j-z-y), its stated counts (occurrences, ayah_count, lemma_count) and its relations per type and direction with the 20 heaviest of each, as get_node_stats lists them (a root's lemmas with their occurrences). A member stated to occur at most 3 times is located: by its own stored edges to places when it has any (located_by EDGE), else among the places the node reaches by its own forms, in a list property (LIST), as a word of their text (TEXT) or, since 4.3.2, as a word inflecting the form in the text's language (STEM; بَرْزَخًا for بَرْزَخ); every place says how it was found. The hits follow as results. | |
| match | No | Added in contract revision 4.3.0. On pages of imported hits: how the query was matched. | |
| total | No | Added in contract revision 4.3.0. On pages of imported hits: every imported hit of the request over all pages (exactly 1 for a word that occurs once); null in node_id order, which does not count ahead. | |
| results | Yes | ||
| truncated | Yes | ||
| references | No | Added in contract revision 4.3.0. The references a reference query named (2:190-193 is 2:190, 2:191, 2:192, 2:193) when nodes with them exist: the results are exactly those nodes, in this order. | |
| next_cursor | No | Added in contract revision 3.1.0. Set exactly when truncated is true; send it as cursor with the same request for the next page. Pages of one generation never overlap or skip. | |
| focus_reason | No | Added in contract revision 4.6.0, on imported pages. Why focus is absent, or taken among several: NO_HIT_NAMED (no hit has a property equal to the query while its name holds it, and none is named so; light matches verses while no root states an English gloss), REFERENCE (a reference query returns its nodes and names no focus), AMBIGUOUS (several nodes are named exactly so; the one ranked first is the focus), NOT_REQUESTED (a later page, or a page sorted by node_id). Absent when exactly one node is named. Since 4.6.0 the node's own name counts (Root n-w-r resolves). |