From d9fb08c9da3d2e8c501ec9badb2e2bd79eb15b93 Mon Sep 17 00:00:00 2001 From: Wanlin Du Date: Mon, 11 Aug 2025 16:12:41 -0700 Subject: feat: migrate tools to use parametersJsonSchema. (#5330) --- packages/core/src/tools/write-file.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'packages/core/src/tools/write-file.ts') diff --git a/packages/core/src/tools/write-file.ts b/packages/core/src/tools/write-file.ts index b018d653..5cdba419 100644 --- a/packages/core/src/tools/write-file.ts +++ b/packages/core/src/tools/write-file.ts @@ -18,7 +18,6 @@ import { Icon, } from './tools.js'; import { ToolErrorType } from './tool-error.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'; @@ -89,21 +88,24 @@ export class WriteFileTool file_path: { description: "The absolute path to the file to write to (e.g., '/home/user/project/file.txt'). Relative paths are not supported.", - type: Type.STRING, + type: 'string', }, content: { description: 'The content to write to the file.', - type: Type.STRING, + type: 'string', }, }, required: ['file_path', 'content'], - type: Type.OBJECT, + type: 'object', }, ); } validateToolParams(params: WriteFileToolParams): string | null { - const errors = SchemaValidator.validate(this.schema.parameters, params); + const errors = SchemaValidator.validate( + this.schema.parametersJsonSchema, + params, + ); if (errors) { return errors; } -- cgit v1.2.3