File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -700,7 +700,7 @@ impl Agents {
700
700
// Here the tool names can take the following forms:
701
701
// - @{server_name}{delimiter}{tool_name}
702
702
// - native_tool_name
703
- name == tool_name
703
+ name == tool_name && matches ! ( origin , & ToolOrigin :: Native )
704
704
|| name. strip_prefix ( "@" ) . is_some_and ( |remainder| {
705
705
remainder
706
706
. split_once ( MCP_SERVER_TOOL_DELIMITER )
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ use tool_manager::{
98
98
} ;
99
99
use tools:: gh_issue:: GhIssueContext ;
100
100
use tools:: {
101
+ NATIVE_TOOLS ,
101
102
OutputKind ,
102
103
QueuedTool ,
103
104
Tool ,
@@ -280,6 +281,28 @@ impl ChatArgs {
280
281
}
281
282
282
283
if let Some ( trust_tools) = self . trust_tools . take ( ) {
284
+ for tool in & trust_tools {
285
+ if !tool. starts_with ( "@" ) && !NATIVE_TOOLS . contains ( & tool. as_str ( ) ) {
286
+ let _ = queue ! (
287
+ stderr,
288
+ style:: SetForegroundColor ( Color :: Yellow ) ,
289
+ style:: Print ( "WARNING: " ) ,
290
+ style:: SetForegroundColor ( Color :: Reset ) ,
291
+ style:: Print ( "--trust-tools arg for custom tool " ) ,
292
+ style:: SetForegroundColor ( Color :: Cyan ) ,
293
+ style:: Print ( tool) ,
294
+ style:: SetForegroundColor ( Color :: Reset ) ,
295
+ style:: Print ( " needs to be prepended with " ) ,
296
+ style:: SetForegroundColor ( Color :: Green ) ,
297
+ style:: Print ( "@{MCPSERVERNAME}/" ) ,
298
+ style:: SetForegroundColor ( Color :: Reset ) ,
299
+ style:: Print ( "\n " ) ,
300
+ ) ;
301
+ }
302
+ }
303
+
304
+ let _ = stderr. flush ( ) ;
305
+
283
306
if let Some ( a) = agents. get_active_mut ( ) {
284
307
a. allowed_tools . extend ( trust_tools) ;
285
308
}
You can’t perform that action at this time.
0 commit comments