Skip to main content
Glama

roam_search_by_text

Read-onlyIdempotent

Search Roam Research blocks by text across all pages or a specific page, and find pages by title prefix; supports pagination and case sensitivity.

Instructions

Search for blocks containing specific text across all pages or within a specific page. Use scope: "page_titles" to search for pages by namespace prefix (e.g., "Convention/" finds all pages starting with that prefix). This tool supports pagination via the limit and offset parameters. Pagination follows hidden-block filtering; block results use UID order and namespace results use title order.

IMPORTANT: call roam_get_guidelines for this graph once per session before using this tool, reads included — conventions change how results are read, not just written.

Input Schema

NameRequiredDescriptionDefault
textYesThe text to search for. When scope is "page_titles", this is the namespace prefix (trailing slash optional).
graphNoTarget graph key from ROAM_GRAPHS config. Defaults to ROAM_DEFAULT_GRAPH. Only needed in multi-graph mode.
limitNoOptional: The maximum number of results to return. Defaults to 50. Use -1 for no limit, but be aware that very large results sets can impact performance.
scopeNoSearch scope: "blocks" for block content (default), "page_titles" for page title namespace prefix matching.blocks
offsetNoOptional: The number of results to skip before returning matches. Useful for pagination. Defaults to 0.
write_keyNoWrite confirmation key. Required for write operations on non-default graphs when write_key is configured.
case_sensitiveNoOptional: Whether the search should be case-sensitive. Defaults to Unicode-aware case-insensitive matching of literal text. Only used when scope is "blocks".
page_title_uidNoOptional: Title or UID of the page to search in (UID is preferred for accuracy). If not provided, searches across all pages. Only used when scope is "blocks".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv5.1.0
    • changedInput schema / properties / case_sensitive / description
      Previous value: -"Optional: Whether the search should be case-sensitive. If false, it will search for the provided text, capitalized versions, and first word capitalized versions. Only used when scope is \"blocks\"."New value: +"Optional: Whether the search should be case-sensitive. Defaults to Unicode-aware case-insensitive matching of literal text. Only used when scope is \"blocks\"."
  2. First observedv2.13.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already cover read-only/idempotent safety, but the description adds real behavioral detail beyond them: pagination via limit/offset, that pagination is applied after hidden-block filtering, and the result ordering rule (UID order for blocks, title order for namespace results). It does not describe the shape or size of returned items, though no output schema exists.

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?

Front-loaded with the core action and scope mode, then pagination/ordering notes, then the prerequisite call in caps. Four sentences plus a note, all substantive, though the ordering clause is somewhat dense and the IMPORTANT block slightly interrupts flow.

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 an 8-parameter read tool with full schema coverage and no output schema, the description covers modes, pagination, ordering, and the mandatory prerequisite. The remaining gap is return-value shape (item fields, whether a total count is included), which nothing else in the definition supplies.

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 baseline is 3; the description goes further by explaining the pagination interaction of limit/offset and the distinct semantics of 'text' under page_titles (namespace prefix, trailing slash optional). Write_key and graph are left entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('search for blocks containing specific text') and defines the two operating modes (all pages vs. a page; blocks vs. page_titles). It does not differentiate against near-siblings like roam_search_for_tag, roam_search_block_refs, or roam_datatomic_query, so an agent may need to reason about which search variant to pick.

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?

Gives an explicit when-to-use rule for the scope parameter (use page_titles for namespace-prefix page lookups, with a concrete 'Convention/' example) and a hard prerequisite to call roam_get_guidelines once per session, including for reads. It lacks exclusionary guidance against sibling search tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.