| 2011 | } |
| 2012 | |
| 2013 | function withRequiredProjectPath(defs: ToolDefinition[]): ToolDefinition[] { |
| 2014 | return defs.map((tool) => { |
| 2015 | if (!tool.inputSchema.properties.projectPath) return tool; |
| 2016 | const required = tool.inputSchema.required ?? []; |
| 2017 | if (required.includes('projectPath')) return tool; |
| 2018 | return { |
| 2019 | ...tool, |
| 2020 | inputSchema: { ...tool.inputSchema, required: [...required, 'projectPath'] }, |
| 2021 | }; |
| 2022 | }); |
| 2023 | } |
| 2024 | |
| 2025 | /** |
| 2026 | * Allowlist-filtered tool definitions WITHOUT an engine — the static surface the |