MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / _check_tool_names

Method _check_tool_names

src/harness/agentic_loop/verifier.py:432–453  ·  view source on GitHub ↗

Check enabled_tools values against the available MCP tool set.

(self, plan_data: dict)

Source from the content-addressed store, hash-verified

430 # ── Tool name validation ─────────────────────────────────────────
431
432 def _check_tool_names(self, plan_data: dict) -> list[str]:
433 """Check enabled_tools values against the available MCP tool set."""
434 if not self._available_tools:
435 return []
436
437 warnings = []
438
439 # Check plan-level enabled_tools in config
440 config = plan_data.get("config", {}) or {}
441 plan_tools = config.get("enabled_tools", [])
442 if isinstance(plan_tools, list):
443 for tool_name in plan_tools:
444 if tool_name not in self._available_tools:
445 warnings.append(
446 f"Unrecognized tool in config.enabled_tools: '{tool_name}'"
447 )
448
449 # Check step-level enabled_tools throughout the workflow
450 workflow = plan_data.get("workflow", [])
451 self._check_steps_tool_names(workflow, warnings)
452
453 return warnings
454
455 def _check_steps_tool_names(self, steps: list, warnings: list) -> None:
456 """Recursively check enabled_tools in nested step structures."""

Callers 1

verifyMethod · 0.95

Calls 2

getMethod · 0.80

Tested by

no test coverage detected