summaryrefslogtreecommitdiff
path: root/packages/core/src/tools/glob.ts
diff options
context:
space:
mode:
authorWanlin Du <[email protected]>2025-08-11 16:12:41 -0700
committerGitHub <[email protected]>2025-08-11 23:12:41 +0000
commitd9fb08c9da3d2e8c501ec9badb2e2bd79eb15b93 (patch)
tree7d07e1586b736c1b6c44e28828aa29205af335ac /packages/core/src/tools/glob.ts
parentf52d073dfbfa4d5091a74bf33ac1c66e51265247 (diff)
feat: migrate tools to use parametersJsonSchema. (#5330)
Diffstat (limited to 'packages/core/src/tools/glob.ts')
-rw-r--r--packages/core/src/tools/glob.ts16
1 files changed, 9 insertions, 7 deletions
diff --git a/packages/core/src/tools/glob.ts b/packages/core/src/tools/glob.ts
index df0cc348..eaedc20f 100644
--- a/packages/core/src/tools/glob.ts
+++ b/packages/core/src/tools/glob.ts
@@ -15,7 +15,6 @@ import {
ToolInvocation,
ToolResult,
} from './tools.js';
-import { Type } from '@google/genai';
import { shortenPath, makeRelative } from '../utils/paths.js';
import { Config } from '../config/config.js';
@@ -255,26 +254,26 @@ export class GlobTool extends BaseDeclarativeTool<GlobToolParams, ToolResult> {
pattern: {
description:
"The glob pattern to match against (e.g., '**/*.py', 'docs/*.md').",
- type: Type.STRING,
+ type: 'string',
},
path: {
description:
'Optional: The absolute path to the directory to search within. If omitted, searches the root directory.',
- type: Type.STRING,
+ type: 'string',
},
case_sensitive: {
description:
'Optional: Whether the search should be case-sensitive. Defaults to false.',
- type: Type.BOOLEAN,
+ type: 'boolean',
},
respect_git_ignore: {
description:
'Optional: Whether to respect .gitignore patterns when finding files. Only available in git repositories. Defaults to true.',
- type: Type.BOOLEAN,
+ type: 'boolean',
},
},
required: ['pattern'],
- type: Type.OBJECT,
+ type: 'object',
},
);
}
@@ -283,7 +282,10 @@ export class GlobTool extends BaseDeclarativeTool<GlobToolParams, ToolResult> {
* Validates the parameters for the tool.
*/
validateToolParams(params: GlobToolParams): string | null {
- const errors = SchemaValidator.validate(this.schema.parameters, params);
+ const errors = SchemaValidator.validate(
+ this.schema.parametersJsonSchema,
+ params,
+ );
if (errors) {
return errors;
}