fromYaml static method

ToolsConfig fromYaml(
  1. Object? node
)

Parses one scope's tools: yaml node.

null yields an empty config. Strict: a non-map node or a non-boolean value throws ConfigException — fallback policy (skip the section, warn, abort) belongs to the caller. A nested mcp: map flattens to mcp:<server> keys; a plain boolean mcp: value stays the aggregate mcp id.

Implementation

static ToolsConfig fromYaml(Object? node) {
  if (node == null) return const ToolsConfig();
  if (node is! YamlMap) {
    throw ConfigException('tools must be a map, got: ${node.runtimeType}');
  }
  return ToolsConfig(tools: _parseToolsEntries(node));
}