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

Function withRequiredProjectPath

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

Source from the content-addressed store, hash-verified

2011}
2012
2013function 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

Callers 1

getToolsMethod · 0.85

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected