| 2021 | } |
| 2022 | |
| 2023 | function withRequiredProjectPath(defs: ToolDefinition[]): ToolDefinition[] { |
| 2024 | return defs.map((tool) => { |
| 2025 | if (!tool.inputSchema.properties.projectPath) return tool; |
| 2026 | const required = tool.inputSchema.required ?? []; |
| 2027 | if (required.includes('projectPath')) return tool; |
| 2028 | return { |
| 2029 | ...tool, |
| 2030 | inputSchema: { ...tool.inputSchema, required: [...required, 'projectPath'] }, |
| 2031 | }; |
| 2032 | }); |
| 2033 | } |
| 2034 | |
| 2035 | /** |
| 2036 | * Allowlist-filtered tool definitions WITHOUT an engine — the static surface the |