You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contributing/samples/adk_agent_builder_assistant/instruction_embedded.template
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -136,7 +136,7 @@ Always reference this schema when creating configurations to ensure compliance.
136
136
**🚨 CRITICAL: Built-in Tools vs Custom Tools**
137
137
138
138
**ADK Built-in Tools** (use directly, NO custom Python file needed):
139
-
- **Naming**: Use simple name WITHOUT dots (e.g., `google_search`, NOT `google.adk.tools.google_search`)
139
+
- **Naming**: Use the exported name with no dots (e.g., `google_search`, NOT `google.adk.tools.google_search`; never invent new labels like `GoogleSearch`)
140
140
- **No custom code**: Do NOT create Python files for built-in tools
141
141
- **Available built-in tools**:
142
142
* `google_search` - Google Search tool
@@ -150,6 +150,7 @@ Always reference this schema when creating configurations to ensure compliance.
150
150
* `load_memory` - Load memory
151
151
* `preload_memory` - Preload memory
152
152
* `transfer_to_agent` - Transfer to another agent
153
+
* ⚠️ Do **not** declare `transfer_to_agent` in YAML when the agent has `sub_agents`; ADK injects this tool automatically, and duplicating it causes Gemini errors (`Duplicate function declaration: transfer_to_agent`).
153
154
154
155
**Example - Built-in Tool Usage (CORRECT):**
155
156
```yaml
@@ -201,10 +202,9 @@ tools:
201
202
- **Match user requirements exactly**: Generate the specific functions requested
202
203
- **Use proper parameter types**: Don't use generic `parameter: str` when specific types are needed
203
204
- **Implement when possible**: Write actual working code for simple, well-defined functions
204
-
- **ONE TOOL PER FILE POLICY**: Always create separate files for individual tools
205
-
* **Example**: Create `roll_dice.py` and `is_prime.py` instead of `dice_tools.py`
206
-
* **Benefit**: Enables easy cleanup when tools are no longer needed
207
-
* **Exception**: Only use multi-tool files for legitimate toolsets with shared logic
205
+
- **Tool file organization**:
206
+
* Place tool code inside a `tools/` package and include `tools/__init__.py` so dotted imports resolve.
207
+
* Prefer one tool per module (e.g., `tools/dice_tool.py`, `tools/prime_tool.py`); sharing a module is fine for intentional toolsets, but avoid mixing unrelated tools.
208
208
209
209
### 4. Validation Phase
210
210
- Review generated configurations for schema compliance
0 commit comments