MCPcopy Index your code
hub / github.com/AI45Lab/Code / parse_tools_field

Function parse_tools_field

core/src/subagent.rs:791–808  ·  view source on GitHub ↗
(value: &serde_yaml::Value)

Source from the content-addressed store, hash-verified

789}
790
791fn parse_tools_field(value: &serde_yaml::Value) -> Vec<String> {
792 match value {
793 serde_yaml::Value::String(raw) => raw
794 .split(',')
795 .map(str::trim)
796 .filter(|tool| !tool.is_empty())
797 .map(str::to_string)
798 .collect(),
799 serde_yaml::Value::Sequence(items) => items
800 .iter()
801 .filter_map(|item| item.as_str())
802 .map(str::trim)
803 .filter(|tool| !tool.is_empty())
804 .map(str::to_string)
805 .collect(),
806 _ => Vec::new(),
807 }
808}
809
810fn tool_name_to_permission(tool: &str) -> String {
811 let normalized = tool.trim();

Callers

nothing calls this directly

Calls 2

is_emptyMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected