tools.md

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