Add and improve JSDoc comments for core tool methods (#3128)

This commit is contained in:
moon jooho
2025-07-04 09:13:02 +09:00
committed by GitHub
parent 654f8aeb61
commit 8d3fec08e5
7 changed files with 55 additions and 6 deletions

View File

@@ -81,7 +81,12 @@ export class WebSearchTool extends BaseTool<
);
}
validateParams(params: WebSearchToolParams): string | null {
/**
* Validates the parameters for the WebSearchTool.
* @param params The parameters to validate
* @returns An error message string if validation fails, null if valid
*/
validateToolParams(params: WebSearchToolParams): string | null {
if (
this.schema.parameters &&
!SchemaValidator.validate(
@@ -105,7 +110,7 @@ export class WebSearchTool extends BaseTool<
params: WebSearchToolParams,
signal: AbortSignal,
): Promise<WebSearchToolResult> {
const validationError = this.validateParams(params);
const validationError = this.validateToolParams(params);
if (validationError) {
return {
llmContent: `Error: Invalid parameters provided. Reason: ${validationError}`,