Use prebuilt tools
In shortUse create_handoff_tool and the memory tools in a ToolNode, and see which calculator, fetch, search and file tools are deprecated in 1.1.0 and removed in 2.0.
- 2 min read
- 4 sections
- Updated
- v1.0.0
- Markdown
tenxgraph.prebuilt.tools holds the handoff and memory tools, plus the deprecated tools below. Pass them to a ToolNode or a prebuilt agent’s tools list, next to your own tools.
Hand off between agents
create_handoff_tool makes a transfer_to_<agent_name> tool. When the model calls it, the graph routes to that node instead of running a function.
from tenxgraph.core.graph import ToolNode
from tenxgraph.prebuilt.tools import create_handoff_tool
transfer_to_billing = create_handoff_tool(
agent_name="billing",
description="Transfer the user to the billing agent for payment questions.",
)
tool_node = ToolNode([transfer_to_billing])Without description, the model sees “Transfer control to billing agent”. See Handoff between agents.
Memory tools
Agent(..., memory=MemoryConfig(...)) and the prebuilt agents’ memory= add the memory tools for you. Build them yourself only for a custom ToolNode:
from tenxgraph.core.graph import ToolNode
from tenxgraph.prebuilt.tools import make_agent_memory_tool, make_user_memory_tool
from tenxgraph.storage.store import MemoryConfig, OpenAIEmbedding, create_local_qdrant_store
store = create_local_qdrant_store("./qdrant_data", OpenAIEmbedding())
config = MemoryConfig(store=store)
tool_node = ToolNode([make_user_memory_tool(config), make_agent_memory_tool(config)])See the memory tools guide and Use the memory store.
Deprecated tools
| Tool | What it does | Fix its settings in code with | Details |
|---|---|---|---|
safe_calculator |
Evaluates arithmetic with Python’s ast, no code execution |
- | Reference |
fetch_url |
Fetches the text of a public HTTP or HTTPS URL | create_fetch_url(allowed_hosts) |
Reference |
google_web_search, vertex_ai_search |
Gemini Google Search grounding, or a Vertex AI Search datastore (google-genai extra) |
create_google_web_search(model), create_vertex_ai_search(datastore, model) |
Reference |
file_read, file_write, file_search |
Read, write and search inside one directory | create_file_tools(root) |
Reference |
In a graph that serves requests, build the fetch and file tools with their factory, so the allowed hosts or the root are fixed in code. Setting the file root through the run config (file_tool_root, workspace_root) is deprecated and removed in 2.0.
create_fetch_url(allowed_hosts) limits fetch_url to the hosts you list. Give vertex_ai_search the full datastore resource path (projects/<project>/locations/global/collections/default_collection/dataStores/<id>).
create_file_tools(root, *, read=True, write=True, search=True, deny=(), use_default_deny=True) returns the selected tools and raises ValueError when root is not an existing directory. deny= adds glob patterns to hide (matched ignoring case against every part of the path under the root and the whole relative path). use_default_deny=False drops the built-in secret patterns, so use it only when the root holds nothing sensitive.
Frequently asked questions
- Can I mix prebuilt tools with custom tools?
- Yes. Pass all tools to a single ToolNode. Prebuilt and custom tools coexist without conflict.
- How do I filter which tools an agent sees?
- Use Agent(..., tools_tags={"tag_name"}) to expose only tools with that tag. Set tags with @tool(tags=[...]).