Built-in tools: files and the task tool
The built-in tools are the tools every deep agent gets without asking: file tools to list, read, write, edit, delete and search files, and a task tool that hands work to a subagent.
Last updated: 29 Sep, 2026 · Deep Agents 0.7
TodoListMiddleware yourself, as write_todos: planning with TodoListMiddleware shows. Summarization and the tool-call patch are still built in.create_agent next to create_deep_agent
The video builds a plain LangChain agent with create_agent and the same model and tool, and draws both. The plain agent is a model node and a tools node. The deep agent has the same two nodes plus middleware hooks around them: one that patches tool calls, one that summarizes long conversations, and one after the model that keeps a to-do list, so a big task is tracked step by step. Middleware is code that runs before or after each model call or tool call; a deep agent is a plain agent with a stack of it. The video draws both graphs; the page prints each agent's tool list, which shows the same difference as text.
Listing the tools the model gets
Start trip.py with search_travel, the catalog tool from Tools: a travel search the agent can call. Everything below goes in the same file, under it. Then build both agents from the same model and tool, and print the names of the tools each one can run. An agent's tools live in its tools node.
from langchain.tools import tool
CATALOG = {
"paris": {
"flight": ["Return flight Delhi to Paris: 42,000 rupees"],
"hotel": ["Seine Budget Inn, Latin Quarter: 5,200 rupees a night",
"Hotel Lumiere, Montmartre: 7,500 rupees a night",
"Le Grand Opera Hotel: 16,000 rupees a night"],
"sight": ["Eiffel Tower summit: 3,100 rupees", "Louvre Museum: 2,000 rupees",
"Seine river cruise: 1,500 rupees", "Versailles day trip: 2,600 rupees",
"Montmartre walking tour: free"],
"food": ["Cafe breakfast and bistro dinner: 3,000 rupees a day"],
},
}
@tool
def search_travel(city: str, kind: str) -> str:
"""Search the travel catalog. kind is "flight", "hotel", "sight" or "food". Prices are in rupees."""
entries = CATALOG.get(city.lower(), {}).get(kind)
return "\n".join(entries) if entries else f"The catalog has no {kind} entries for {city}."from deepagents import create_deep_agent
from langchain.chat_models import init_chat_model
model = init_chat_model("groq:openai/gpt-oss-120b", temperature=0, max_retries=6)from langchain.agents import create_agent
plain = create_agent(model, tools=[search_travel])
deep = create_deep_agent(model=model, tools=[search_travel])The built-in tools in a run
The run below prints both lists, then asks the deep agent for something only its built-in tools can do: save the hotel options to a file and list the folder.
print("create_agent: ", sorted(plain.nodes["tools"].bound.tools_by_name))
print("create_deep_agent:", sorted(deep.nodes["tools"].bound.tools_by_name))
result = deep.invoke({"messages": [{"role": "user", "content": "Save the Paris hotel options to /trip/hotels.md, then list the files in /trip."}]})
for message in result["messages"]:
print(f"{message.type:<5}", message.text or [(c["name"], c["args"]) for c in message.tool_calls])create_agent: ['search_travel']
create_deep_agent: ['delete', 'edit_file', 'execute', 'glob', 'grep', 'ls', 'read_file', 'search_travel', 'task', 'write_file']
human Save the Paris hotel options to /trip/hotels.md, then list the files in /trip.
ai [('search_travel', {'city': 'Paris', 'kind': 'hotel'})]
tool Seine Budget Inn, Latin Quarter: 5,200 rupees a night
Hotel Lumiere, Montmartre: 7,500 rupees a night
Le Grand Opera Hotel: 16,000 rupees a night
ai [('write_file', {'content': 'Seine Budget Inn, Latin Quarter: 5,200 rupees a night\nHotel Lumiere, Montmartre: 7,500 rupees a night\nLe Grand Opera Hotel: 16,000 rupees a night', 'file_path': '/trip/hotels.md'})]
tool Updated file /trip/hotels.md
ai [('ls', {'path': '/trip'})]
tool ['/trip/hotels.md']
ai The hotel options have been saved to **/trip/hotels.md**.
Here are the files currently in the **/trip** directory:
- /trip/hotels.mdWhat the two lists and the run show
- create_agent has only the tool you gave it.
- create_deep_agent adds
ls,read_file,write_file,edit_file,delete,globandgrepfor files, andtaskfor subagents. - execute is registered too, but the model is only offered it when the agent's backend can run shell commands, such as a sandbox. With the default backend it stays hidden.
- In the run the agent looked up the hotels, wrote them to
/trip/hotels.mdwithwrite_file, then listed/tripwithls. No file appeared on your disk; the next part of the course shows where it went.
What each built-in tool does
| Tool | What it does |
|---|---|
ls | Lists the files in a folder |
read_file | Reads a file, with line numbers, in pages for long files |
write_file | Creates a file or replaces one |
edit_file | Replaces an exact piece of text inside a file |
delete | Deletes a file or a folder (new in 0.7) |
glob / grep | Finds files by name pattern / searches their contents |
task | Starts a subagent with a job and returns its final report |
Where the built-in tools help
- Keeping a plan or a draft in a file the agent updates as it works.
- Saving a large tool result so the conversation stays short.
- Handing a side job to a subagent without writing any delegation code.
/trip/hotels.md and then looking for it on disk finds nothing; Virtual filesystem: files in the agent's state explains why.Related
- Previous: create_deep_agent: your first deep agent
- Next: System prompt: giving the agent its job
- Reference: Virtual filesystem access
- Ask the deep agent to save the Paris sights to
/trip/sights.mdand list/tripagain. - Ask it to delete
/trip/hotels.mdin the same request and read which tool it calls. - Print
sorted(deep.nodes["tools"].bound.tools_by_name)after adding a second tool of your own.
This is what real progress feels like.