fix: clarify that sandbox functions are only callable via execute_typescript (#8096)

Signed-off-by: Dale Lakes <6843636+spitfire55@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dale Lakes
2026-03-25 09:20:01 -04:00
committed by GitHub
parent 8cd04aa76b
commit 70003c2e22
@@ -478,15 +478,21 @@ impl McpClientTrait for CodeExecutionClient {
let disclosure_style_moim = match self.disclosure {
ToolDisclosure::Catalog => {
let available_fns: Vec<_> = code_mode
.list_functions()
.functions
let functions = code_mode.list_functions().functions;
let sandbox_only: Vec<_> = functions
.iter()
.filter(|f| !crate::agents::extension_manager::is_first_class_extension(&f.namespace))
.map(|f| format!("{}.{}", &f.namespace, &f.name))
.collect();
format!("Available functions: {}
Use the list_functions & get_function_details tools to see tool signatures and input/output types before calling execute_typescript.", available_fns.join(", "))
let mut msg = String::new();
if !sandbox_only.is_empty() {
msg.push_str(&format!(
"Additional functions available ONLY via execute_typescript (do NOT call these as direct tool calls): {}",
sandbox_only.join(", ")
));
}
msg.push_str("\n\n Use the list_functions & get_function_details tools to see tool signatures and input/output types before calling execute_typescript.");
msg
}
ToolDisclosure::Filesystem => {
let available_filepaths: Vec<_> = code_mode