roam_search_by_text
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
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to search for. When scope is "page_titles", this is the namespace prefix (trailing slash optional). | |
| graph | No | Target graph key from ROAM_GRAPHS config. Defaults to ROAM_DEFAULT_GRAPH. Only needed in multi-graph mode. | |
| limit | No | Optional: 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. | |
| scope | No | Search scope: "blocks" for block content (default), "page_titles" for page title namespace prefix matching. | blocks |
| offset | No | Optional: The number of results to skip before returning matches. Useful for pagination. Defaults to 0. | |
| write_key | No | Write confirmation key. Required for write operations on non-default graphs when write_key is configured. | |
| case_sensitive | No | Optional: 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_uid | No | Optional: 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". |