Forked from soumyajit7038/python-tools
Project Files
src / tools / checkForBugsInFile.ts
import { tool } from "@lmstudio/sdk";
import { z } from "zod";
import { checkPythonFileForBugs } from "../utils/pythonBugChecker";
import { getToolDefinition } from "../utils/toolRegistry";
const TOOL_DEFINITION = getToolDefinition("check_for_bugs_in_file");
export const checkForBugsInFileTool = tool({
name: TOOL_DEFINITION.name,
description:
`${TOOL_DEFINITION.description} This compiles syntax with py_compile and does not execute the file normally.`,
parameters: {
filePath: z.string().min(1).max(500).describe("Python file path relative to workspace or absolute inside workspace."),
},
implementation: async ({ filePath }) => {
return await checkPythonFileForBugs(filePath);
},
});