Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Tool API Redesign: Naming & Query-Shape Detection

Two improvements to the core tool API: consistent parameter naming across all symbol and search tools, and automatic detection of regex intent in symbols to prevent confusing errors.


API Naming Changes

Parameter names have been standardized across symbol and search tools. Old names are removed — update any saved prompts or scripts.

Parameter renames

ToolOld paramNew param
symbolsname_pathsymbol
symbolspatternquery
referencesname_pathsymbol
symbol_atname_pathsymbol
replace_symbolname_pathsymbol
remove_symbolname_pathsymbol
rename_symbolname_pathsymbol
semantic_searchprojectproject_id
memoryprojectproject_id

Tool renames

Old nameNew name
search_patterngrep
find_fileglob

The renamed tools (grep, glob) are shorter and match the mental model agents already have for these operations.


Query-Shape Detection in symbols

symbols now detects when a query looks like a regex pattern and returns a corrective hint instead of silently returning wrong results.

Problem it solves

Agents occasionally pass regex patterns to symbols expecting it to match multiple symbols — but symbols does substring matching on symbol names, not regex. A query like handle_.*_event matches nothing (or coincidentally matches a symbol with .* in its name), giving a misleading empty result.

Behavior

If the query contains regex metacharacters (.*, .+, ^, $, \w, \d, |, (...)) it is flagged as regex-like and a RecoverableError is returned:

{
  "error": "query looks like a regex pattern — use grep(pattern=...) for regex search",
  "hint": "symbols matches by substring; grep searches file content by pattern"
}

When it fires

QueryDetected asAction
handle_eventplain substringnormal symbol search
handle_.*_eventregex-likeRecoverableError → redirect to grep
^MyStruct$regex-likeRecoverableError → redirect to grep
foo|barregex-likeRecoverableError → redirect to grep

Correct tool for each intent

// Find a symbol by name substring
symbols(query="handle_event")

// Find code matching a pattern across files
grep(pattern="handle_.*_event")