{"id":"html_grep","name":"HTML Grep","alias":"HTMLGrep","aliases":[],"description_short":"Search expressions in a page HTML and return surrounding context.","description_long":"\n    Fetch the HTML of a given URL and search for one or more expressions in it.\n\n    For each occurrence found, the agent returns the matching text along with\n    a configurable number of characters of context on each side. Each expression\n    can be a literal substring (default) or a Python regular expression, and is\n    configured independently (case sensitivity, max matches, context size).\n    ","description_tool_prompt":"\n    Fetch the HTML of a given URL and search for one or more expressions in it.\n\n    For each occurrence found, the agent returns the matching text along with\n    a configurable number of characters of context on each side. Each expression\n    can be a literal substring (default) or a Python regular expression, and is\n    configured independently (case sensitivity, max matches, context size).\n    ","source":"SiteCrawler or Browser fetching","conversation_examples":["Find every occurrence of \"add to cart\" in https://www.example.com/p/123","Grep the regex \"price\\s*:\\s*\\$\\d+\" on https://www.example.com"],"tags":["content"],"available_in_chat":true,"available_in_deepthink":true,"available_in_mcp":true,"mcp_audience":"all","config":{"type":"object","properties":{"queries":{"description":"List of search queries to run against the fetched HTML. Each query is processed independently and shared by all items in a batch.","items":{"$ref":"#/$defs/HtmlGrepQuery"},"minItems":1,"title":"Queries","type":"array"}},"required":["queries"],"$defs":{"HtmlGrepQuery":{"properties":{"expression":{"description":"Expression to search in the HTML. Interpreted as a literal substring unless `is_regex` is True.","minLength":1,"title":"Expression","type":"string"},"n_chars":{"default":100,"description":"Number of characters of context to keep on each side of the match.","minimum":0,"title":"N Chars","type":"integer"},"is_regex":{"default":false,"description":"If True, `expression` is interpreted as a Python regular expression. Otherwise, it is treated as a literal substring.","title":"Is Regex","type":"boolean"},"case_sensitive":{"default":true,"description":"If True, the search is case-sensitive.","title":"Case Sensitive","type":"boolean"},"max_matches":{"default":10,"description":"Maximum number of matches returned for this query. Use 0 (or a negative value) to return all matches.","title":"Max Matches","type":"integer"}},"required":["expression"],"title":"HtmlGrepQuery","type":"object"}}},"item":{"type":"object","properties":{"url":{"description":"The URL to fetch the HTML from. Temporary uploaded URLs on https://app.botify.com/:organization/:project/o/storage/tmp are allowed.","title":"Url","type":"string"}},"required":["url"]},"response":{"$defs":{"HtmlGrepMatch":{"properties":{"match":{"description":"The exact substring that matched","title":"Match","type":"string"},"context":{"description":"The match with up to `n_chars` characters around it","title":"Context","type":"string"},"start":{"description":"Start offset of the match in the HTML","title":"Start","type":"integer"},"end":{"description":"End offset of the match in the HTML","title":"End","type":"integer"}},"required":["match","context","start","end"],"title":"HtmlGrepMatch","type":"object"},"HtmlGrepQuery":{"properties":{"expression":{"description":"Expression to search in the HTML. Interpreted as a literal substring unless `is_regex` is True.","minLength":1,"title":"Expression","type":"string"},"n_chars":{"default":100,"description":"Number of characters of context to keep on each side of the match.","minimum":0,"title":"N Chars","type":"integer"},"is_regex":{"default":false,"description":"If True, `expression` is interpreted as a Python regular expression. Otherwise, it is treated as a literal substring.","title":"Is Regex","type":"boolean"},"case_sensitive":{"default":true,"description":"If True, the search is case-sensitive.","title":"Case Sensitive","type":"boolean"},"max_matches":{"default":10,"description":"Maximum number of matches returned for this query. Use 0 (or a negative value) to return all matches.","title":"Max Matches","type":"integer"}},"required":["expression"],"title":"HtmlGrepQuery","type":"object"},"HtmlGrepQueryResult":{"properties":{"query":{"$ref":"#/$defs/HtmlGrepQuery","description":"The query this result corresponds to (echoed back)"},"matches":{"default":[],"description":"Matches found for this query, up to `max_matches`","items":{"$ref":"#/$defs/HtmlGrepMatch"},"title":"Matches","type":"array"},"total_matches":{"default":0,"description":"Total number of matches found in the HTML for this query (may be greater than `len(matches)` when truncated).","title":"Total Matches","type":"integer"},"truncated":{"default":false,"description":"True if results were truncated by `max_matches`.","title":"Truncated","type":"boolean"}},"required":["query"],"title":"HtmlGrepQueryResult","type":"object"}},"properties":{"crawl":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"If fetched from SiteCrawler, the crawl slug used","title":"Crawl"},"results":{"default":[],"description":"One result per input query, in the same order as `queries`.","items":{"$ref":"#/$defs/HtmlGrepQueryResult"},"title":"Results","type":"array"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Reason for an empty result, if any","title":"Reason"}},"title":"HtmlGrepProcessedItem","type":"object"},"has_canvas":false,"open_canvas_automatically":false}