chore(tools): add toJSON to tools and invocations to reduce logging verbosity (#22899)

This commit is contained in:
Alisa
2026-03-24 16:08:29 -07:00
committed by GitHub
parent 397ff84b0e
commit 71a9131709
2 changed files with 69 additions and 0 deletions
+16
View File
@@ -379,6 +379,12 @@ export abstract class BaseToolInvocation<
updateOutput?: (output: ToolLiveOutput) => void,
options?: ExecuteOptions,
): Promise<TResult>;
toJSON() {
return {
params: this.params,
};
}
}
/**
@@ -498,6 +504,16 @@ export abstract class DeclarativeTool<
return cloned;
}
toJSON() {
return {
name: this.name,
displayName: this.displayName,
description: this.description,
kind: this.kind,
parameterSchema: this.parameterSchema,
};
}
get isReadOnly(): boolean {
return READ_ONLY_KINDS.includes(this.kind);
}