validate_repo_path
Verify if a filesystem path exists and contains a valid git repository to ensure proper repository tracking and monitoring.
Instructions
Check whether a given filesystem path exists and is a git repository.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to check |
Implementation Reference
- src/tools/branches.ts:73-87 (handler)The handler for 'validate_repo_path' checks if a path exists and is a valid git repository using 'existsSync' and 'isGitRepo'.
// --- validate_repo_path --- server.tool( "validate_repo_path", "Check whether a given filesystem path exists and is a git repository.", { path: z.string().describe("Absolute path to check") }, async ({ path }) => { if (!existsSync(path)) { return { content: [{ type: "text", text: `Path does not exist: ${path}` }] }; } if (!isGitRepo(path)) { return { content: [{ type: "text", text: `Path exists but is not a git repo (no .git directory): ${path}` }] }; } return { content: [{ type: "text", text: `Valid git repository: ${path}` }] }; } );