| 1985 | } |
| 1986 | |
| 1987 | function withRequiredProjectPath(defs: ToolDefinition[]): ToolDefinition[] { |
| 1988 | return defs.map((tool) => { |
| 1989 | if (!tool.inputSchema.properties.projectPath) return tool; |
| 1990 | const required = tool.inputSchema.required ?? []; |
| 1991 | if (required.includes('projectPath')) return tool; |
| 1992 | return { |
| 1993 | ...tool, |
| 1994 | inputSchema: { ...tool.inputSchema, required: [...required, 'projectPath'] }, |
| 1995 | }; |
| 1996 | }); |
| 1997 | } |
| 1998 | |
| 1999 | /** |
| 2000 | * Allowlist-filtered tool definitions WITHOUT an engine — the static surface the |