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:
@@ -478,15 +478,21 @@ impl McpClientTrait for CodeExecutionClient {
|
|||||||
|
|
||||||
let disclosure_style_moim = match self.disclosure {
|
let disclosure_style_moim = match self.disclosure {
|
||||||
ToolDisclosure::Catalog => {
|
ToolDisclosure::Catalog => {
|
||||||
let available_fns: Vec<_> = code_mode
|
let functions = code_mode.list_functions().functions;
|
||||||
.list_functions()
|
let sandbox_only: Vec<_> = functions
|
||||||
.functions
|
|
||||||
.iter()
|
.iter()
|
||||||
|
.filter(|f| !crate::agents::extension_manager::is_first_class_extension(&f.namespace))
|
||||||
.map(|f| format!("{}.{}", &f.namespace, &f.name))
|
.map(|f| format!("{}.{}", &f.namespace, &f.name))
|
||||||
.collect();
|
.collect();
|
||||||
format!("Available functions: {}
|
let mut msg = String::new();
|
||||||
|
if !sandbox_only.is_empty() {
|
||||||
Use the list_functions & get_function_details tools to see tool signatures and input/output types before calling execute_typescript.", available_fns.join(", "))
|
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 => {
|
ToolDisclosure::Filesystem => {
|
||||||
let available_filepaths: Vec<_> = code_mode
|
let available_filepaths: Vec<_> = code_mode
|
||||||
|
|||||||
Reference in New Issue
Block a user