MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / withRequiredProjectPath

Function withRequiredProjectPath

src/mcp/tools.ts:2023–2033  ·  view source on GitHub ↗
(defs: ToolDefinition[])

Source from the content-addressed store, hash-verified

2021}
2022
2023function 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

Callers 1

getToolsMethod · 0.85

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected