Skip to content

feat: add GODOT_DEVTOOL_FULL_TOOLS_LIST env var for full tools/list#7

Open
srtan9er wants to merge 1 commit into
wangdiandao:mainfrom
srtan9er:feat/full-tools-list-env
Open

feat: add GODOT_DEVTOOL_FULL_TOOLS_LIST env var for full tools/list#7
srtan9er wants to merge 1 commit into
wangdiandao:mainfrom
srtan9er:feat/full-tools-list-env

Conversation

@srtan9er

@srtan9er srtan9er commented Jun 25, 2026

Copy link
Copy Markdown

概述

当设置环境变量 GODOT_DEVTOOL_FULL_TOOLS_LIST=true 时,tools/list 返回全部 235 个工具而非仅 3 个入口工具。默认行为(Router 模式)保持不变。

动机

VS Code Copilot 等 MCP 客户端不支持通过 get_capabilities 动态发现工具——它们仅在初始化时读取 tools/list 并将其中列出的工具注册为可调用函数。这导致 godot-devtool 在 Copilot 中只能使用 3 个入口工具。

修改内容

  • src/server/toolListPolicy.ts — 在 createToolListPage() 中检查 process.env['GODOT_DEVTOOL_FULL_TOOLS_LIST'],为 true 时返回全量工具
  • 新增 TOOL_LIST_MODE_FULL 常量
  • 新增 ENV_FULL_TOOLS_LIST 常量
  • withToolListMeta() 在 full 模式下省略 fullSchemaSource / fullSchemaCall

使用方式

{
  "mcpServers": {
    "godot-devtool": {
      "command": "node",
      "args": ["path/to/build/index.js"],
      "env": {
        "GODOT_PATH": "path/to/godot.exe",
        "GODOT_DEVTOOL_FULL_TOOLS_LIST": "true"
      }
    }
  }
}

验证

  • tsc --noEmit 零错误
  • npm run build 成功
  • ✅ 不设环境变量时行为与现有完全一致

⚠️ 此 PR 全部代码由 AI(GitHub Copilot)生成。请仔细审查后再合并。

Summary by CodeRabbit

  • New Features
    • Added support for two tool-list display modes: a streamlined router view and a full tools view.
    • Tool-list metadata now reflects which mode is active, and unnecessary schema details are hidden in the full-list view.

When GODOT_DEVTOOL_FULL_TOOLS_LIST=true, tools/list returns all 235 tools
instead of only 3 entry tools. This enables clients like VS Code Copilot that
do not support dynamic tool discovery via get_capabilities.

The default behavior (router mode) is unchanged.

Generated entirely by AI (GitHub Copilot). Please review carefully before merging.
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8f6651f7-8f82-436b-8357-e43258a0dd0a

📥 Commits

Reviewing files that changed from the base of the PR and between e004f8d and 71bb2bb.

📒 Files selected for processing (1)
  • src/server/toolListPolicy.ts

📝 Walkthrough

Walkthrough

The tool list policy now supports router and full modes via an environment variable. Page creation selects either the full tool list or the entry-tool subset, and metadata reflects the selected mode.

Changes

Tool list mode changes

Layer / File(s) Summary
Mode constants and page selection
src/server/toolListPolicy.ts
Adds TOOL_LIST_MODE_FULL and ENV_FULL_TOOLS_LIST, then switches createToolListPage between the full tool list and the entry-tool subset based on the environment variable.
Metadata by mode
src/server/toolListPolicy.ts
Extends withToolListMeta with fullList, sets toolListMode, and removes fullSchemaSource and fullSchemaCall when full mode is enabled.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through router paths today,
and found a fuller tool-display.
One whisker set the mode just right,
one carrot glowed in metadata light.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding an env var to switch tools/list to a full tool list.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant