summaryrefslogtreecommitdiff
path: root/packages/core/src/tools/grep.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/core/src/tools/grep.ts')
-rw-r--r--packages/core/src/tools/grep.ts14
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/core/src/tools/grep.ts b/packages/core/src/tools/grep.ts
index 8e2b84f1..f8ecdc9c 100644
--- a/packages/core/src/tools/grep.ts
+++ b/packages/core/src/tools/grep.ts
@@ -17,7 +17,6 @@ import {
ToolInvocation,
ToolResult,
} from './tools.js';
-import { Type } from '@google/genai';
import { SchemaValidator } from '../utils/schemaValidator.js';
import { makeRelative, shortenPath } from '../utils/paths.js';
import { getErrorMessage, isNodeError } from '../utils/errors.js';
@@ -550,21 +549,21 @@ export class GrepTool extends BaseDeclarativeTool<GrepToolParams, ToolResult> {
pattern: {
description:
"The regular expression (regex) pattern to search for within file contents (e.g., 'function\\s+myFunction', 'import\\s+\\{.*\\}\\s+from\\s+.*').",
- type: Type.STRING,
+ type: 'string',
},
path: {
description:
'Optional: The absolute path to the directory to search within. If omitted, searches the current working directory.',
- type: Type.STRING,
+ type: 'string',
},
include: {
description:
"Optional: A glob pattern to filter which files are searched (e.g., '*.js', '*.{ts,tsx}', 'src/**'). If omitted, searches all files (respecting potential global ignores).",
- type: Type.STRING,
+ type: 'string',
},
},
required: ['pattern'],
- type: Type.OBJECT,
+ type: 'object',
},
);
}
@@ -616,7 +615,10 @@ export class GrepTool extends BaseDeclarativeTool<GrepToolParams, ToolResult> {
* @returns An error message string if invalid, null otherwise
*/
validateToolParams(params: GrepToolParams): string | null {
- const errors = SchemaValidator.validate(this.schema.parameters, params);
+ const errors = SchemaValidator.validate(
+ this.schema.parametersJsonSchema,
+ params,
+ );
if (errors) {
return errors;
}