tools.md

 1# Tools
 2
 3Zed's built-in agent has access to these tools for reading, searching, and editing your codebase.
 4
 5You can configure permissions for tool actions, including situations where they are automatically approved, automatically denied, or require your confirmation on a case-by-case basis. See [Tool Permissions](./tool-permissions.md) for the list of permission-gated tools and details.
 6
 7## Read & Search Tools
 8
 9### `diagnostics`
10
11Gets errors and warnings for either a specific file or the entire project, useful after making edits to determine if further changes are needed.
12When a path is provided, shows all diagnostics for that specific file.
13When no path is provided, shows a summary of error and warning counts for all files in the project.
14
15### `fetch`
16
17Fetches a URL and returns the content as Markdown. Useful for providing docs as context.
18
19### `find_path`
20
21Quickly finds files by matching glob patterns (like "\*_/_.js"), returning matching file paths alphabetically.
22
23### `grep`
24
25Searches file contents across the project using regular expressions, preferred for finding symbols in code without knowing exact file paths.
26
27### `list_directory`
28
29Lists files and directories in a given path, providing an overview of filesystem contents.
30
31### `now`
32
33Returns the current date and time.
34
35### `open`
36
37Opens a file or URL with the default application associated with it on the user's operating system.
38
39### `read_file`
40
41Reads the content of a specified file in the project, allowing access to file contents.
42
43### `thinking`
44
45Allows the Agent to work through problems, brainstorm ideas, or plan without executing actions, useful for complex problem-solving.
46
47### `web_search`
48
49Searches the web for information, providing results with snippets and links from relevant web pages, useful for accessing real-time information.
50
51## Edit Tools
52
53### `copy_path`
54
55Copies a file or directory recursively in the project, more efficient than manually reading and writing files when duplicating content.
56
57### `create_directory`
58
59Creates a new directory at the specified path within the project, creating all necessary parent directories (similar to `mkdir -p`).
60
61### `delete_path`
62
63Deletes a file or directory (including contents recursively) at the specified path and confirms the deletion.
64
65### `edit_file`
66
67Edits files by replacing specific text with new content.
68
69### `move_path`
70
71Moves or renames a file or directory in the project, performing a rename if only the filename differs.
72
73### `restore_file_from_disk`
74
75Discards unsaved changes in open buffers by reloading file contents from disk. Useful for resetting files to their on-disk state before retrying an edit.
76
77### `save_file`
78
79Saves files that have unsaved changes. Used when files need to be saved before further edits can be made.
80
81### `terminal`
82
83Executes shell commands and returns the combined output, creating a new shell process for each invocation.
84
85## Other Tools
86
87### `subagent`
88
89Spawns a subagent with its own context window to perform a delegated task. Useful for running parallel investigations, completing self-contained tasks, or performing research where only the outcome matters. Each subagent has access to the same tools as the parent agent.