Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions documentation/docs/guides/managing-tools/code-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ Traditional MCP tool calling and Code Mode are two different approaches to the s

| Aspect | Traditional | Code Mode |
|--------|------------------|-----------|
| **Tool Discovery** | All tools from enabled extensions, for example:<br/>• `shell`<br/>• `write`<br/>• `github__list_issues`<br/>• `github__get_pull_request`<br/>• `slack__send_message`<br/>• ... *potentially many more* | Code Mode extension's meta-tools:<br/>• `list_functions`<br/>• `get_function_details`<br/>• `execute_javascript`<br/><br/>The LLM uses these tools to discover tools from other enabled extensions as needed |
| **Tool Discovery** | All tools from enabled extensions, for example:<br/>• `shell`<br/>• `write`<br/>• `github__list_issues`<br/>• `github__get_pull_request`<br/>• `slack__send_message`<br/>• ... *potentially many more* | Code Mode extension's meta-tools:<br/>• `list_functions`<br/>• `get_function_details`<br/>• `execute_javascript`<br/><br/>The LLM uses these tools to discover tools from other enabled extensions as needed (first-class tools like `shell` and `load_skill` are also advertised directly and need no discovery) |
| **Tool Calling** | • Sequential tool calls<br/>• Each result sent to the LLM before the next call | • May require tool discovery calls<br/>• Multiple tool calls batched in one execution<br/>• Intermediate results are chained and processed locally |
| **Context Window** | Every LLM call includes all tool definitions from enabled extensions | Every LLM call includes the 3 meta-tool definitions, plus any tool definitions previously discovered in the session |
| **Context Window** | Every LLM call includes all tool definitions from enabled extensions | Every LLM call includes the 3 meta-tool definitions, `load_skill`, and the other first-class (unprefixed) tools — such as `shell`, `load`, and delegate — plus any tool definitions previously discovered in the session |
| **Best For** | • 1-3 enabled extensions<br/>• Simple tasks using 1-2 tools | • 5+ extensions<br/>• Well-defined multi-step workflows |

:::info Text-Only Results
Expand All @@ -50,6 +50,15 @@ Call `list_functions` to discover exact tool names and short descriptions, then
original JSON input and output schemas. Recursive schemas remain JSON data.
Use the returned names exactly, including unprefixed names for first-class tools.

:::note
When Code Mode is enabled, `load_skill` is still advertised and callable as a
direct tool — it doesn't need to be discovered through `list_functions` or
invoked via `execute_javascript`. Skills are still listed in goose's
instructions at session start, so a skill can be loaded in the same way as without
Code Mode. See [Agent Skills](/docs/guides/context-engineering/using-skills) for
more on how skills work.
:::

Pass JavaScript to `execute_javascript` with an `async function run()` entry point:

```javascript
Expand Down