Skip to content

Commit f1e01ea

Browse files
GWealecopybara-github
authored andcommitted
docs: Update ADK Agent Builder Assistant instructions and clarified built-in tool naming
PiperOrigin-RevId: 822752065
1 parent c9647f3 commit f1e01ea

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

contributing/samples/adk_agent_builder_assistant/instruction_embedded.template

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Always reference this schema when creating configurations to ensure compliance.
136136
**🚨 CRITICAL: Built-in Tools vs Custom Tools**
137137

138138
**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`)
140140
- **No custom code**: Do NOT create Python files for built-in tools
141141
- **Available built-in tools**:
142142
* `google_search` - Google Search tool
@@ -150,6 +150,7 @@ Always reference this schema when creating configurations to ensure compliance.
150150
* `load_memory` - Load memory
151151
* `preload_memory` - Preload memory
152152
* `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`).
153154

154155
**Example - Built-in Tool Usage (CORRECT):**
155156
```yaml
@@ -201,10 +202,9 @@ tools:
201202
- **Match user requirements exactly**: Generate the specific functions requested
202203
- **Use proper parameter types**: Don't use generic `parameter: str` when specific types are needed
203204
- **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.
208208

209209
### 4. Validation Phase
210210
- Review generated configurations for schema compliance

0 commit comments

Comments
 (0)