From 42aa37cfc0a670255f92e18143bac744237e0eea Mon Sep 17 00:00:00 2001 From: michaelxer Date: Mon, 22 Jun 2026 06:38:04 +0700 Subject: [PATCH] docs: update enabledTools docs and schema comment to reflect resource/prompt gating The enabledTools gate now also controls MCP resource and prompt registration (not just tools). Update the configuration docs and schema field comment to document this behavioral change. Refs: #4435, #4436 --- docs/configuration.md | 6 +++--- nanobot/config/schema.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index e32d23cd..3b4730fc 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1829,9 +1829,9 @@ Use `enabledTools` to register only a subset of tools from an MCP server: `enabledTools` accepts either the raw MCP tool name (for example `read_file`) or the wrapped nanobot tool name (for example `mcp_filesystem_write_file`). -- Omit `enabledTools`, or set it to `["*"]`, to register all tools. -- Set `enabledTools` to `[]` to register no tools from that server. -- Set `enabledTools` to a non-empty list of names to register only that subset. +- Omit `enabledTools`, or set it to `["*"]`, to register all capabilities (tools, resources, and prompts). +- Set `enabledTools` to `[]` to register no tools from that server. Resources and prompts are also skipped, since they have no per-name filter. +- Set `enabledTools` to a non-empty list of names to register only those tools — resources and prompts are not registered. MCP tools are automatically discovered and registered on startup. The LLM can use them alongside built-in tools — no extra configuration needed. diff --git a/nanobot/config/schema.py b/nanobot/config/schema.py index ac8022db..09fa1b02 100644 --- a/nanobot/config/schema.py +++ b/nanobot/config/schema.py @@ -307,7 +307,7 @@ class MCPServerConfig(Base): url: str = "" # HTTP/SSE: endpoint URL headers: dict[str, str] = Field(default_factory=dict) # HTTP/SSE: custom headers tool_timeout: int = 30 # seconds before a tool call is cancelled - enabled_tools: list[str] = Field(default_factory=lambda: ["*"]) # Only register these tools; accepts raw MCP names or wrapped mcp__ names; ["*"] = all tools; [] = no tools + enabled_tools: list[str] = Field(default_factory=lambda: ["*"]) # Only register these tools; accepts raw MCP names or wrapped mcp__ names; ["*"] = all capabilities (tools, resources, prompts); any restriction = only listed tools, no resources/prompts def _lazy_default(module_path: str, class_name: str) -> Any: