Skip to content

utils

Shared helpers for manifest-based skills.

is_tool_allowed(allowed_tools, tool_name)

Return True when a manifest allowlist permits the named runtime tool.

An empty or absent allowlist permits every tool.

Parameters:

Name Type Description Default
allowed_tools List[str]

Tool names permitted by a skill manifest.

required
tool_name str

Runtime tool name to check.

required

Returns:

Type Description
bool

True when the tool is permitted.

Source code in src/mada/core/skills/utils.py
def is_tool_allowed(allowed_tools: List[str], tool_name: str) -> bool:
    """
    Return True when a manifest allowlist permits the named runtime tool.

    An empty or absent allowlist permits every tool.

    Args:
        allowed_tools: Tool names permitted by a skill manifest.
        tool_name: Runtime tool name to check.

    Returns:
        True when the tool is permitted.
    """
    if not allowed_tools:
        return True
    return tool_name in allowed_tools