Commit e9fd336
Implemented selective disable of tools to spare with the initial schema size (#1035)
* feat(mcp): selectively disable tools to reduce initial schema size
* fix(mcp): address greptile review feedback
- Reorder createCallToolHandler so the disabled-tool check runs before
validateMultiRepoAccess, giving config-disabled tools a consistent
"Unknown tool" response regardless of multi-repo state.
- Mark CodegraphConfig.mcp.disabledTools optional to match the runtime
guard (config.mcp?.disabledTools) and tolerate partial configs.
- Update list_repos single-repo test to reflect the unified
"Unknown tool" path.
- Apply biome formatting to normalizeToolName.
* docs(mcp): document mcp.disabledTools config
- README: short subsection under Configuration with example and link.
- docs/guides/mcp-tool-filtering.md: extensive guide covering motivation,
name normalization, runtime behavior, full tool catalog, and recipes.
* docs(config): replace mcp-only guide with full config reference
Per review feedback, the previous guide was too narrowly scoped. Replace
with docs/guides/configuration.md covering every key in DEFAULTS:
file selection, build, query, embeddings, llm, search, ci, manifesto,
check, coChange, analysis, community, structure, risk, display, mcp.
README points to the new guide and keeps the short MCP tool-filtering
example for the PR's headline feature.
* fix(mcp): simplify disabledTools to always be an array (#1035)
Impact: 1 functions changed, 1 affected
* refactor(mcp): remove unreachable list_repos branch (#1035)
The 'list_repos' tool is excluded from 'enabledToolNames' when 'multiRepo'
is false, so 'createCallToolHandler' rejects single-repo 'list_repos'
calls with 'Unknown tool' before they ever reach 'validateMultiRepoAccess'.
That made the 'name === "list_repos"' branch unreachable. Drop the dead
branch and the now-unused 'name' parameter; existing test
'rejects list_repos in single-repo mode' covers the early-rejection path.
---------
Co-authored-by: carlos-alm <contato@carlosalmeida.com>
Co-authored-by: carlos-alm <127798846+carlos-alm@users.noreply.github.com>1 parent 20b8596 commit e9fd336
8 files changed
Lines changed: 554 additions & 17 deletions
File tree
- docs/guides
- src
- infrastructure
- mcp
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
773 | 773 | | |
774 | 774 | | |
775 | 775 | | |
776 | | - | |
| 776 | + | |
777 | 777 | | |
778 | 778 | | |
779 | 779 | | |
| |||
833 | 833 | | |
834 | 834 | | |
835 | 835 | | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
836 | 850 | | |
837 | 851 | | |
838 | 852 | | |
| |||
0 commit comments