Agent tools

glob

glob({ pattern, path? })

Find files by name pattern. One call instead of walking a tree folder by folder.

category: readfreereturns paths
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

patternstringrequired

**/*.md, notes/*.{txt,md}, src/**/*.test.js.

pathstring

Folder to search in. The workspace root by default.

The patterns

WrittenMatches
*.mdMarkdown files at that level
**/*.mdMarkdown files at any depth
src/**/*.{ts,tsx}Either extension, under src
**/test-*Anything whose name starts with test-

Why it matters to the bill

A walk is one turn per folder

Listing a tree by hand costs a turn for each level. A pattern costs one. The system prompt tells the agent to use glob and grep instead of guessing paths, for exactly that reason.

What usually follows

read { paths } with several of the matches in one call — the two together are how an agent takes in a project in two turns.