diff --git a/documentation/docs/guides/managing-tools/code-mode.md b/documentation/docs/guides/managing-tools/code-mode.md index 0a01e3b432dc..adef657c1966 100644 --- a/documentation/docs/guides/managing-tools/code-mode.md +++ b/documentation/docs/guides/managing-tools/code-mode.md @@ -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:
• `shell`
• `write`
• `github__list_issues`
• `github__get_pull_request`
• `slack__send_message`
• ... *potentially many more* | Code Mode extension's meta-tools:
• `list_functions`
• `get_function_details`
• `execute_javascript`

The LLM uses these tools to discover tools from other enabled extensions as needed | +| **Tool Discovery** | All tools from enabled extensions, for example:
• `shell`
• `write`
• `github__list_issues`
• `github__get_pull_request`
• `slack__send_message`
• ... *potentially many more* | Code Mode extension's meta-tools:
• `list_functions`
• `get_function_details`
• `execute_javascript`

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
• Each result sent to the LLM before the next call | • May require tool discovery calls
• Multiple tool calls batched in one execution
• 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
• Simple tasks using 1-2 tools | • 5+ extensions
• Well-defined multi-step workflows | :::info Text-Only Results @@ -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