Files
google__adk-docs/docs/integrations/code-execution.md
Kristopher Overholt 58f3aaebca Replace documentation URLs and paths for adk.dev migration (#1536)
* Replace google.github.io/adk-docs URLs and /adk-docs/ paths with adk.dev

Migrate all hardcoded documentation references to use the new custom
domain. Update root-relative links to remove the /adk-docs/ subpath
prefix since the site will be served from the root of adk.dev.

* Additional fixes
2026-04-01 12:48:27 -05:00

1.1 KiB

catalog_title, catalog_description, catalog_icon, catalog_tags
catalog_title catalog_description catalog_icon catalog_tags
Code Execution Execute code and debug using Gemini models /integrations/assets/gemini-spark.svg
code
google

Gemini API Code Execution tool for ADK

Supported in ADKPython v0.1.0Java v0.2.0

The built_in_code_execution tool enables the agent to execute code, specifically when using Gemini 2 and higher models. This allows the model to perform tasks like calculations, data manipulation, or running small scripts.

!!! warning "Warning: Single tool per agent limitation"

This tool can only be used ***by itself*** within an agent instance.
For more information about this limitation and workarounds, see
[Limitations for ADK tools](/tools/limitations/#one-tool-one-agent).

=== "Python"

```py
--8<-- "examples/python/snippets/tools/built-in-tools/code_execution.py"
```

=== "Java"

```java
--8<-- "examples/java/snippets/src/main/java/tools/CodeExecutionAgentApp.java:full_code"
```