1<!--
2 GOLD STANDARD EXAMPLE: Reference Documentation
3
4 This example demonstrates documentation for API/reference content like tools,
5 actions, or other enumerable items.
6
7 Key patterns to note:
8 - Anchor IDs on categories and individual items for deep-linking
9 - Opening paragraph explains what these are and where they're used
10 - Organized into logical categories
11 - Each item has a clear, actionable description
12 - Links to related configuration docs
13 - "See Also" section for related topics
14-->
15
16---
17
18title: AI Agent Tools - Zed
19description: Built-in tools for Zed's AI agent including file editing, code search, terminal commands, web search, and diagnostics.
20
21---
22
23# Tools
24
25Zed'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.
26
27You 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.
28
29To add custom tools beyond these built-in ones, see [MCP servers](./mcp.md).
30
31## Read & Search Tools {#read-search-tools}
32
33### `diagnostics` {#diagnostics}
34
35Gets errors and warnings for either a specific file or the entire project, useful after making edits to determine if further changes are needed.
36When a path is provided, shows all diagnostics for that specific file.
37When no path is provided, shows a summary of error and warning counts for all files in the project.
38
39### `fetch` {#fetch}
40
41Fetches a URL and returns the content as Markdown. Useful for providing docs as context.
42
43### `find_path` {#find-path}
44
45Quickly finds files by matching glob patterns (like `**/*.js`), returning matching file paths alphabetically.
46
47### `grep` {#grep}
48
49Searches file contents across the project using regular expressions, preferred for finding symbols in code without knowing exact file paths.
50
51### `list_directory` {#list-directory}
52
53Lists files and directories in a given path, providing an overview of filesystem contents.
54
55### `now` {#now}
56
57Returns the current date and time.
58
59### `open` {#open}
60
61Opens a file or URL with the default application associated with it on the user's operating system.
62
63### `read_file` {#read-file}
64
65Reads the content of a specified file in the project, allowing access to file contents.
66
67### `thinking` {#thinking}
68
69Allows the Agent to work through problems, brainstorm ideas, or plan without executing actions, useful for complex problem-solving.
70
71### `web_search` {#web-search}
72
73Searches the web for information, providing results with snippets and links from relevant web pages, useful for accessing real-time information.
74
75## Edit Tools {#edit-tools}
76
77### `copy_path` {#copy-path}
78
79Copies a file or directory recursively in the project, more efficient than manually reading and writing files when duplicating content.
80
81### `create_directory` {#create-directory}
82
83Creates a new directory at the specified path within the project, creating all necessary parent directories (similar to `mkdir -p`).
84
85### `delete_path` {#delete-path}
86
87Deletes a file or directory (including contents recursively) at the specified path and confirms the deletion.
88
89### `edit_file` {#edit-file}
90
91Edits files by replacing specific text with new content.
92
93### `move_path` {#move-path}
94
95Moves or renames a file or directory in the project, performing a rename if only the filename differs.
96
97### `restore_file_from_disk` {#restore-file}
98
99Discards unsaved changes in open buffers by reloading file contents from disk. Useful for resetting files to their on-disk state before retrying an edit.
100
101### `save_file` {#save-file}
102
103Saves files that have unsaved changes. Used when files need to be saved before further edits can be made.
104
105### `terminal` {#terminal}
106
107Executes shell commands and returns the combined output, creating a new shell process for each invocation.
108
109## Other Tools {#other-tools}
110
111### `subagent` {#subagent}
112
113Spawns 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.
114
115## See Also {#see-also}
116
117- [Agent Panel](./agent-panel.md) — Where you interact with AI agents
118- [Tool Permissions](./tool-permissions.md) — Configure which tools require approval
119- [MCP Servers](./mcp.md) — Add custom tools via Model Context Protocol