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 {
700700 // Here the tool names can take the following forms:
701701 // - @{server_name}{delimiter}{tool_name}
702702 // - native_tool_name
703- name == tool_name
703+ name == tool_name && matches ! ( origin , & ToolOrigin :: Native )
704704 || name. strip_prefix ( "@" ) . is_some_and ( |remainder| {
705705 remainder
706706 . split_once ( MCP_SERVER_TOOL_DELIMITER )
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ use tool_manager::{
9898} ;
9999use tools:: gh_issue:: GhIssueContext ;
100100use tools:: {
101+ NATIVE_TOOLS ,
101102 OutputKind ,
102103 QueuedTool ,
103104 Tool ,
@@ -280,6 +281,28 @@ impl ChatArgs {
280281 }
281282
282283 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+
283306 if let Some ( a) = agents. get_active_mut ( ) {
284307 a. allowed_tools . extend ( trust_tools) ;
285308 }
You can’t perform that action at this time.
0 commit comments