diff options
| author | Jaana Dogan <[email protected]> | 2025-04-18 11:06:30 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-04-18 11:06:30 -0700 |
| commit | e1fac4025606246e284b3e370d22100e8a25d652 (patch) | |
| tree | 549c3edd9a844756f97c219f5e8b52c2b171fd19 /packages/cli/src/tools/read-file.tool.ts | |
| parent | 7cd3b95317c4d9263e514f33589cb359766d463b (diff) | |
Rename invalidParams to validateToolParams (#12)
Methods should be verbs. Fixes #4.
Diffstat (limited to 'packages/cli/src/tools/read-file.tool.ts')
| -rw-r--r-- | packages/cli/src/tools/read-file.tool.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/cli/src/tools/read-file.tool.ts b/packages/cli/src/tools/read-file.tool.ts index 9737e75d..feb9cbae 100644 --- a/packages/cli/src/tools/read-file.tool.ts +++ b/packages/cli/src/tools/read-file.tool.ts @@ -106,7 +106,7 @@ export class ReadFileTool extends BaseTool< * @param params Parameters to validate * @returns True if parameters are valid, false otherwise */ - invalidParams(params: ReadFileToolParams): string | null { + validateToolParams(params: ReadFileToolParams): string | null { if ( this.schema.parameters && !SchemaValidator.validate( @@ -210,8 +210,7 @@ export class ReadFileTool extends BaseTool< * @returns Result with file contents */ async execute(params: ReadFileToolParams): Promise<ToolResult> { - const validationError = this.invalidParams(params); - const filePath = params.file_path; + const validationError = this.validateToolParams(params); if (validationError) { return { llmContent: `Error: Invalid parameters provided. Reason: ${validationError}`, @@ -219,6 +218,7 @@ export class ReadFileTool extends BaseTool< }; } + const filePath = params.file_path; try { if (!fs.existsSync(filePath)) { return { |
