| 91 | * Interface for a tool builder that validates parameters and creates invocations. |
| 92 | */ |
| 93 | export interface ToolBuilder< |
| 94 | TParams extends object, |
| 95 | TResult extends ToolResult, |
| 96 | > { |
| 97 | /** |
| 98 | * The internal name of the tool (used for API calls). |
| 99 | */ |
| 100 | name: string; |
| 101 | |
| 102 | /** |
| 103 | * The user-friendly display name of the tool. |
| 104 | */ |
| 105 | displayName: string; |
| 106 | |
| 107 | /** |
| 108 | * Description of what the tool does. |
| 109 | */ |
| 110 | description: string; |
| 111 | |
| 112 | /** |
| 113 | * The kind of tool for categorization and permissions |
| 114 | */ |
| 115 | kind: Kind; |
| 116 | |
| 117 | /** |
| 118 | * Function declaration schema from @google/genai. |
| 119 | */ |
| 120 | schema: FunctionDeclaration; |
| 121 | |
| 122 | /** |
| 123 | * Whether the tool's output should be rendered as markdown. |
| 124 | */ |
| 125 | isOutputMarkdown: boolean; |
| 126 | |
| 127 | /** |
| 128 | * Whether the tool supports live (streaming) output. |
| 129 | */ |
| 130 | canUpdateOutput: boolean; |
| 131 | |
| 132 | /** |
| 133 | * Validates raw parameters and builds a ready-to-execute invocation. |
| 134 | * @param params The raw, untrusted parameters from the model. |
| 135 | * @returns A valid `ToolInvocation` if successful. Throws an error if validation fails. |
| 136 | */ |
| 137 | build(params: TParams): ToolInvocation<TParams, TResult>; |
| 138 | } |
| 139 | |
| 140 | /** |
| 141 | * New base class for tools that separates validation from execution. |
no outgoing calls
no test coverage detected