Skip to content

disclosure

disclosure

Tool-disclosure layer: advertise toolsets by class, reveal tools on demand.

The full crew-dcs surface is large, so the default tools/list advertises only the primary tier plus two meta tools: - list_domo_capabilities: the catalog of classes/toolsets (not per-tool schemas) - reveal_toolset(name): per-session ctx.enable_components(tags={name}) to expose a class's tools for the calling session (fires tools/list_changed).

apply_primary_only

apply_primary_only(mcp: Any) -> None

Restrict the default advertised surface to the primary tier.

Source code in src/crew_dcs/mcp_server/disclosure.py
60
61
62
def apply_primary_only(mcp: Any) -> None:
    """Restrict the default advertised surface to the primary tier."""
    mcp.enable(tags={"primary"}, only=True)

build_capabilities_catalog

build_capabilities_catalog(tools: list[Any]) -> list[dict]

Group tools by their class tag into an advertisable catalog.

Source code in src/crew_dcs/mcp_server/disclosure.py
24
25
26
27
28
29
30
31
32
33
def build_capabilities_catalog(tools: list[Any]) -> list[dict]:
    """Group tools by their class tag into an advertisable catalog."""
    by_class: dict[str, list[str]] = {}
    for tool in tools:
        for cls in _class_tags(getattr(tool, "tags", None)):
            by_class.setdefault(cls, []).append(tool.name)
    return [
        {"class": cls, "tool_count": len(names), "tools": sorted(names)}
        for cls, names in sorted(by_class.items())
    ]

make_list_capabilities

make_list_capabilities(catalog: list[dict])

Build the list_domo_capabilities tool from a captured catalog.

Source code in src/crew_dcs/mcp_server/disclosure.py
36
37
38
39
40
41
42
43
def make_list_capabilities(catalog: list[dict]):
    """Build the list_domo_capabilities tool from a captured catalog."""

    async def list_domo_capabilities() -> list[dict]:
        """List Domo capability toolsets (by class). Use reveal_toolset to expand one."""
        return catalog

    return list_domo_capabilities

make_reveal_toolset

make_reveal_toolset(tools: list[Any])

Build the reveal_toolset tool over the full (captured) tool list.

Source code in src/crew_dcs/mcp_server/disclosure.py
46
47
48
49
50
51
52
53
54
55
56
57
def make_reveal_toolset(tools: list[Any]):
    """Build the reveal_toolset tool over the full (captured) tool list."""

    async def reveal_toolset(name: str, ctx: Context) -> dict:
        """Reveal a capability toolset's tools for this session, then call them."""
        await ctx.enable_components(tags={name})
        revealed = [
            t.name for t in tools if name in (getattr(t, "tags", None) or set())
        ]
        return {"revealed": revealed}

    return reveal_toolset