MCPcopy Create free account
hub / github.com/AI45Lab/Code / is_tool_allowed

Method is_tool_allowed

core/src/skills/mod.rs:238–249  ·  view source on GitHub ↗

Check if a tool is allowed by this skill

(&self, tool_name: &str)

Source from the content-addressed store, hash-verified

236
237 /// Check if a tool is allowed by this skill
238 pub fn is_tool_allowed(&self, tool_name: &str) -> bool {
239 let permissions = self.parse_allowed_tools();
240
241 if permissions.is_empty() {
242 return false;
243 }
244
245 // Check if any permission matches
246 permissions.iter().any(|perm| {
247 (perm.tool == "*" || perm.tool.eq_ignore_ascii_case(tool_name)) && perm.pattern == "*"
248 })
249 }
250
251 /// Get the skill content formatted for injection into system prompt
252 pub fn to_system_prompt(&self) -> String {

Callers 2

executeMethod · 0.80

Calls 2

parse_allowed_toolsMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected