text-find
Locate patterns or substrings in text and return all matches with context.
Behavior
- Case-sensitive by default.
- Supports standard Python regex syntax in
pattern. - Returns every match (not just the first), with line/character position and the surrounding lines.
- Returns an empty result if no matches — not an error.
When to use vs assess / process_text
text-find— exact substring or regex match. Deterministic. No LLM cost.assess— natural-language predicate (semantic match). LLM-backed.process_text— open-ended transformation with an instruction.
If you want "does this contain the literal string X?" → text-find. If you want "does this contain mention of X?" (paraphrases count) → assess.
Examples
{"thought": "find every TODO in the document", "tool": "text-find", "source": "$step1", "pattern": "TODO"}
{"thought": "locate error lines mentioning a timeout", "tool": "text-find", "source": "$step1", "pattern": "ERROR.*timeout", "context_lines": 3}