()
| 752 | * note in a description only adds once `cg` is loaded; the schemas are static). |
| 753 | */ |
| 754 | export function getStaticTools(): ToolDefinition[] { |
| 755 | const raw = process.env.CODEGRAPH_MCP_TOOLS; |
| 756 | if (!raw || !raw.trim()) { |
| 757 | return tools.filter(t => DEFAULT_MCP_TOOLS.has(t.name.replace(/^codegraph_/, ''))); |
| 758 | } |
| 759 | const allow = new Set(raw.split(',').map(s => s.trim().replace(/^codegraph_/, '')).filter(Boolean)); |
| 760 | return allow.size ? tools.filter(t => allow.has(t.name.replace(/^codegraph_/, ''))) : tools; |
| 761 | } |
| 762 | |
| 763 | /** |
| 764 | * The MCP tools served by DEFAULT (short names). Pared to ONLY `codegraph_explore` |
no test coverage detected