debug_validation_report was registered in rebuild_registry and listed in tools/list unconditionally — only call() consulted OPENPENCIL_DEBUG_TOOLS. A production client (flag unset) still saw the debug tool in its catalog and could invoke it, getting a bare ToolFailed. That leaks the debug surface into the production catalog. Gate it everywhere instead of only at call time: rebuild_registry registers the tool only when debug_tools_enabled(), and tools_list_response appends the debug schema — now a separate DEBUG_TOOL_SCHEMAS const, removed from TOOL_SCHEMAS — only when the flag is set. A client without the flag never sees the tool at all, matching the TS design where debug tools ship only in a debug build. debug_tools_enabled() is promoted to pub and re-exported from op-mcp. The tools/list catalog test now exercises both gate states (82 tools flag-off, debug tool present flag-on). |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||