codeModeVisible property

bool codeModeVisible
final

Whether this tool should remain visible in the standard tools/list response when the parent Server annotation has codeMode: true.

When Server.codeMode is true, the standard tool list is replaced by just the search and execute tools so that LLMs orchestrate everything through the JavaScript sandbox. Individual tools can opt back in to the standard list by setting codeModeVisible: true.

When Server.codeMode is false, this field has no effect — all tools are always listed.

This is independent of codeMode: a tool can be visible in the standard list and also available inside the sandbox, or visible only in one of the two surfaces.

Example — expose a single tool directly alongside search/execute:

@Tool(description: 'Ping the server', codeModeVisible: true)
String ping() => 'pong';

Defaults to false.

Implementation

final bool codeModeVisible;