AnthropicTool
The AnthropicTool module defines Anthropic provider tools and the schemas for their inputs and results. It covers Anthropic-owned tools such as Bash, Code Execution, Computer Use, Memory, Text Editor, Web Search, Web Fetch, and Tool Search, which can be attached to Anthropic-backed Effect AI language model requests.
Models
AnthropicTool type
Signature
type AnthropicTool =
| ReturnType<typeof Bash_20241022>
| ReturnType<typeof Bash_20250124>
| ReturnType<typeof CodeExecution_20250522>
| ReturnType<typeof CodeExecution_20250825>
| ReturnType<typeof ComputerUse_20241022>
| ReturnType<typeof ComputerUse_20250124>
| ReturnType<typeof ComputerUse_20251124>
| ReturnType<typeof Memory_20250818>
| ReturnType<typeof TextEditor_20241022>
| ReturnType<typeof TextEditor_20250124>
| ReturnType<typeof TextEditor_20250429>
| ReturnType<typeof TextEditor_20250728>
| ReturnType<typeof ToolSearchRegex_20251119>
| ReturnType<typeof ToolSearchBM25_20251119>
| ReturnType<typeof WebFetch_20250910>
| ReturnType<typeof WebSearch_20250305>;CodeExecution_20250825_Parameters type
Input payload for the 2025-08-25 Anthropic code execution tool.
When to use
Use when exposing the 2025-08-25 code-execution payload separately from the provider tool definition, such as at a transport or persistence boundary.
Details
The payload has a single code field containing the source code string to execute.
See
CodeExecution_20250825for the provider-defined tool that consumes this payload
Signature
type CodeExecution_20250825_Parameters = typeof CodeExecution_20250825_Parameters.Type;CodeExecutionBashCommand type
Input payload for a bash command routed through the Anthropic code execution tool.
When to use
Use when representing a provider-executed bash command request for the 2025-05-22 code execution tool.
Details
The payload uses type: "bash_code_execution" to distinguish bash execution from programmatic code and text editor operations, and command contains the bash command to run.
See
CodeExecutionProgrammaticToolCallfor programmatic code execution inputCodeExecutionTextEditorViewfor viewing files through text editor code executionCodeExecutionTextEditorCreatefor creating files through text editor code executionCodeExecutionTextEditorStrReplacefor replacing text through text editor code executionCodeExecution_20250522for the provider-defined tool that consumes this payload
Signature
type CodeExecutionBashCommand = typeof CodeExecutionBashCommand.Type;CodeExecutionProgrammaticToolCall type
Input payload for a programmatic code execution tool call, including the source code to execute.
Signature
type CodeExecutionProgrammaticToolCall = typeof CodeExecutionProgrammaticToolCall.Type;CodeExecutionTextEditorCreate type
Input payload for creating a file through the text editor code execution tool, optionally including initial file text.
Signature
type CodeExecutionTextEditorCreate = typeof CodeExecutionTextEditorCreate.Type;CodeExecutionTextEditorStrReplace type
Input payload for replacing text in a file through the text editor code execution tool.
Signature
type CodeExecutionTextEditorStrReplace = typeof CodeExecutionTextEditorStrReplace.Type;CodeExecutionTextEditorView type
Input payload for the view command of Anthropic's text editor code execution tool.
When to use
Use when working at the Anthropic protocol boundary and the code-execution view request must be distinguished from standalone text-editor view requests.
Details
The payload is discriminated by type: "text_editor_code_execution" and command: "view". The path field identifies the file to view.
Gotchas
This code execution view payload does not include view_range; line ranges are part of the standalone text editor view payload, not this code execution payload.
See
CodeExecution_20250522for the provider-defined code execution tool that includes this payloadTextEditorViewCommandfor the standalone text editor view payload
Signature
type CodeExecutionTextEditorView = typeof CodeExecutionTextEditorView.Type;ComputerUseDoubleClickAction type
Computer-use action payload for performing a double click, optionally at a specific coordinate.
Signature
type ComputerUseDoubleClickAction = typeof ComputerUseDoubleClickAction.Type;ComputerUseHoldKeyAction type
Computer-use action payload for holding a key for a specified duration.
When to use
Use to represent a key that should remain pressed for a measured interval.
Details
Set action to "hold_key", text to the key to hold, and duration to the number of seconds to hold it.
See
ComputerUseKeyActionfor a single key press or key combination without a hold duration
Signature
type ComputerUseHoldKeyAction = typeof ComputerUseHoldKeyAction.Type;ComputerUseKeyAction type
Computer-use action payload for pressing a key or key combination.
When to use
Use when typing parsed computer-use key action payloads after schema validation, where provider-specific key-name validation is handled outside TypeScript.
Details
The payload uses action: "key" and stores the key or key combination to press in text, such as "Return", "ctrl+c", or "ctrl+s".
Gotchas
text is typed as string; the paired schema does not validate provider-specific key names or key combinations.
Signature
type ComputerUseKeyAction = typeof ComputerUseKeyAction.Type;ComputerUseLeftClickAction type
Computer-use action payload for performing a left click, optionally at a specific coordinate.
Signature
type ComputerUseLeftClickAction = typeof ComputerUseLeftClickAction.Type;ComputerUseLeftClickDragAction type
Computer-use action payload for dragging from a start coordinate to an end coordinate.
Signature
type ComputerUseLeftClickDragAction = typeof ComputerUseLeftClickDragAction.Type;ComputerUseLeftMouseDownAction type
Computer-use action payload for pressing and holding the left mouse button, optionally at a specific coordinate.
Signature
type ComputerUseLeftMouseDownAction = typeof ComputerUseLeftMouseDownAction.Type;ComputerUseLeftMouseUpAction type
Computer-use action payload for releasing the left mouse button, optionally at a specific coordinate.
Signature
type ComputerUseLeftMouseUpAction = typeof ComputerUseLeftMouseUpAction.Type;ComputerUseMiddleClickAction type
Computer-use action payload for performing a middle click, optionally at a specific coordinate.
Signature
type ComputerUseMiddleClickAction = typeof ComputerUseMiddleClickAction.Type;ComputerUseMouseMoveAction type
Computer-use action payload for moving the mouse cursor to a specific coordinate.
Signature
type ComputerUseMouseMoveAction = typeof ComputerUseMouseMoveAction.Type;ComputerUseRightClickAction type
Computer-use action payload for performing a right click, optionally at a specific coordinate.
Signature
type ComputerUseRightClickAction = typeof ComputerUseRightClickAction.Type;ComputerUseScreenshotAction type
Computer-use action payload for capturing the current display.
Signature
type ComputerUseScreenshotAction = typeof ComputerUseScreenshotAction.Type;ComputerUseScrollAction type
Computer-use action payload for scrolling by a specified amount in a specified direction, optionally from a coordinate.
Signature
type ComputerUseScrollAction = typeof ComputerUseScrollAction.Type;ComputerUseTripleClickAction type
Computer-use action payload for performing a triple click, optionally at a specific coordinate.
Signature
type ComputerUseTripleClickAction = typeof ComputerUseTripleClickAction.Type;ComputerUseWaitAction type
Computer-use action payload for pausing for a specified duration.
Signature
type ComputerUseWaitAction = typeof ComputerUseWaitAction.Type;ComputerUseZoomAction type
Computer-use action payload for zooming into a specific screen region.
Gotchas
The enclosing computer-use tool must be configured with enableZoom: true. region is only a four-number tuple and does not validate corner ordering or display bounds.
Signature
type ComputerUseZoomAction = typeof ComputerUseZoomAction.Type;Coordinate type
An [x, y] screen coordinate in pixels.
Signature
type Coordinate = typeof Coordinate.Type;MemoryCreateCommand type
Memory tool command payload for creating a new file at a path.
Signature
type MemoryCreateCommand = typeof MemoryCreateCommand.Type;MemoryDeleteCommand type
Memory tool command payload for deleting a file or directory at a path.
Signature
type MemoryDeleteCommand = typeof MemoryDeleteCommand.Type;MemoryInsertCommand type
Memory tool command payload for inserting text at a specific line in a file.
Signature
type MemoryInsertCommand = typeof MemoryInsertCommand.Type;MemoryRenameCommand type
Memory tool command payload for renaming or moving a file or directory.
Signature
type MemoryRenameCommand = typeof MemoryRenameCommand.Type;MemoryStrReplaceCommand type
Memory tool command payload for replacing text in a file.
Signature
type MemoryStrReplaceCommand = typeof MemoryStrReplaceCommand.Type;MemoryViewCommand type
Memory tool command payload for viewing a file or directory, optionally with a file line range.
Signature
type MemoryViewCommand = typeof MemoryViewCommand.Type;ModifierKey type
Modifier key literals.
Details
Allowed values are "alt", "ctrl", "meta", and "shift".
Signature
type ModifierKey = typeof ModifierKey.Type;An [x1, y1, x2, y2] screen region in pixels, from top-left to bottom-right.
Signature
type Region = typeof Region.Type;ScrollDirection type
Direction used by computer-use scroll actions: "up", "down", "left", or "right".
Signature
type ScrollDirection = typeof ScrollDirection.Type;TextEditorCreateCommand type
Text editor command payload for creating a new file with the specified content.
When to use
Use when typing parsed text-editor create command payloads after schema validation and before dispatching to Anthropic tool handlers.
Gotchas
The command fails if the file already exists or if parent directories are missing.
Signature
type TextEditorCreateCommand = typeof TextEditorCreateCommand.Type;TextEditorInsertCommand type
Text editor command payload for inserting text after a specific line number in a file.
Signature
type TextEditorInsertCommand = typeof TextEditorInsertCommand.Type;TextEditorStrReplaceCommand type
Text editor command payload for replacing one exact, unique string in a file.
When to use
Use when typing parsed text-editor replace command payloads that must carry one exact old_str match.
Gotchas
The old_str must match exactly, including whitespace and indentation, and must be unique in the file.
Signature
type TextEditorStrReplaceCommand = typeof TextEditorStrReplaceCommand.Type;TextEditorUndoEditCommand type
Text editor command payload for undoing the most recent edit to a file.
Gotchas
Available for text_editor_20241022 and text_editor_20250124, but not for text_editor_20250429 or text_editor_20250728.
Signature
type TextEditorUndoEditCommand = typeof TextEditorUndoEditCommand.Type;TextEditorViewCommand type
Text editor command payload for viewing file contents or listing directory contents.
Details
view_range is a 1-indexed [start, end] tuple where -1 means through the end of the file.
Signature
type TextEditorViewCommand = typeof TextEditorViewCommand.Type;ToolSearchBM25Parameters type
Type of the parameters Claude supplies when invoking BM25 natural-language Anthropic tool search.
Signature
type ToolSearchBM25Parameters = typeof ToolSearchBM25Parameters.Type;ToolSearchRegexParameters type
Type of the parameters Claude supplies when invoking regex-based Anthropic tool search.
Details
Claude constructs regex patterns using Python's re.search() syntax. Maximum query length: 200 characters.
Signature
type ToolSearchRegexParameters = typeof ToolSearchRegexParameters.Type;TypeAction type
Computer-use action payload for typing a text string.
Details
The payload uses action: "type" and a text string containing the text to enter.
Signature
type TypeAction = typeof TypeAction.Type;A [start, end] 1-indexed line range for viewing file contents, using -1 as the end value to read through the end of the file.
When to use
Use when typing view_range for memory or text editor view commands.
Signature
type ViewRange = typeof ViewRange.Type;WebFetch_20250910_Args type
Configuration arguments for the Anthropic web fetch tool, including usage limits, domain filters, citation settings, and token limits.
When to use
Use when typing parsed web-fetch tool configuration shared by the provider-defined tool and request-building code.
Gotchas
allowedDomains and blockedDomains are mutually exclusive. maxContentTokens is approximate and does not apply to binary content such as PDFs.
Signature
type WebFetch_20250910_Args = typeof WebFetch_20250910_Args.Type;WebFetchCitationsConfig type
Configuration payload for enabling or disabling citations on web fetch results.
When to use
Use when typing parsed web-fetch citation configuration shared between request arguments and handler code.
Details
The payload contains the enabled flag. citations is optional on WebFetch_20250910_Args, and citations are disabled by default.
See
WebFetch_20250910_Argsfor the argument schema that consumes this configuration
Signature
type WebFetchCitationsConfig = typeof WebFetchCitationsConfig.Type;WebFetchParameters type
Type of the parameters Claude supplies when invoking the Anthropic web fetch tool.
When to use
Use when typing Claude-supplied web-fetch tool parameters after schema validation, before enforcing URL provenance or length constraints.
Details
The payload contains the single url parameter for Anthropic web fetch.
Gotchas
The URL must be user-provided or from prior search/fetch results. Maximum URL length is 250 characters.
Signature
type WebFetchParameters = typeof WebFetchParameters.Type;WebSearch_20250305_Args type
Configuration arguments for the Anthropic web search tool, including usage limits, domain filters, and optional user location.
Gotchas
allowedDomains and blockedDomains are mutually exclusive.
Signature
type WebSearch_20250305_Args = typeof WebSearch_20250305_Args.Type;WebSearchParameters type
Type of the parameters Claude supplies when invoking the Anthropic web search tool.
Details
Contains the generated search query used by WebSearch_20250305.
See
WebSearch_20250305for the provider-defined tool that consumes this payload
Signature
type WebSearchParameters = typeof WebSearchParameters.Type;Schemas
CodeExecution_20250825_Parameters
Schema for the 2025-08-25 code execution tool input, containing the code to execute.
When to use
Use when you need the schema for code-execution input at the Anthropic protocol boundary before sending source code to the 2025-08-25 tool.
See
CodeExecution_20250825for the provider-defined tool that consumes this schema
Signature
declare const CodeExecution_20250825_Parameters: Struct<{
readonly code: String;
}>;CodeExecutionBashCommand
Schema for the bash_code_execution input variant of Anthropic Code Execution.
When to use
Use when validating or constructing a bash command request for CodeExecution_20250522.
Details
The schema requires type to be "bash_code_execution" and command to contain the bash command sent to Anthropic.
See
CodeExecution_20250522for the provider-defined tool that consumes this input variant
Signature
declare const CodeExecutionBashCommand: Struct<{
readonly command: String;
readonly type: Literal<"bash_code_execution">;
}>;CodeExecutionProgrammaticToolCall
Schema for a code execution request that asks Anthropic to run source code as a programmatic tool call.
When to use
Use when constructing or validating a programmatic tool call for the Anthropic Code Execution tool.
See
CodeExecution_20250522for the parent tool definition
Signature
declare const CodeExecutionProgrammaticToolCall: Struct<{
readonly code: String;
readonly type: Literal<"programmatic-tool-call">;
}>;CodeExecutionTextEditorCreate
Schema for a text editor code execution request that creates a file at a path.
When to use
Use when validating or constructing an Anthropic text_editor_code_execution tool call that should create a file.
Details
The request is discriminated by type: "text_editor_code_execution" and command: "create". It requires path and accepts optional file_text; the schema allows file_text to be omitted, null, or a string.
See
CodeExecution_20250522for the provider-defined tool that consumes this requestCodeExecutionTextEditorViewfor the matching view requestCodeExecutionTextEditorStrReplacefor the matching replace request
Signature
declare const CodeExecutionTextEditorCreate: Struct<{
readonly command: Literal<"create">;
readonly file_text: optional<NullOr<String>>;
readonly path: String;
readonly type: Literal<"text_editor_code_execution">;
}>;CodeExecutionTextEditorStrReplace
Schema for a code execution text editor request that replaces one exact string in a file.
When to use
Use when validating or constructing the str_replace text editor operation for the 2025-05-22 Anthropic code execution tool.
Gotchas
The old_str must match the file contents exactly, including whitespace and indentation, and must identify a single occurrence.
See
CodeExecutionTextEditorViewfor reading file contents before choosing the replacement textCodeExecution_20250522for the provider-defined tool that consumes this payload
Signature
declare const CodeExecutionTextEditorStrReplace: Struct<{
readonly command: Literal<"str_replace">;
readonly new_str: String;
readonly old_str: String;
readonly path: String;
readonly type: Literal<"text_editor_code_execution">;
}>;CodeExecutionTextEditorView
Schema for a code execution text editor request that views a file by path.
When to use
Use when you need the schema for provider-bound code-execution view requests before distinguishing them from create or replace text-editor commands.
Details
The encoded payload uses type: "text_editor_code_execution", command: "view", and a path string.
See
CodeExecutionTextEditorCreatefor the command that creates a fileCodeExecutionTextEditorStrReplacefor the command that replaces text in a file
Signature
declare const CodeExecutionTextEditorView: Struct<{
readonly command: Literal<"view">;
readonly path: String;
readonly type: Literal<"text_editor_code_execution">;
}>;ComputerUseDoubleClickAction
Schema for a computer-use action that performs a double click.
When to use
Use to validate or construct an Anthropic computer-use payload for double clicking at the current mouse position or at a specific screen coordinate.
Details
The encoded payload uses action: "double_click". The optional coordinate field supplies the [x, y] pixel position; when omitted, the action uses the current mouse position.
Gotchas
The coordinate schema only checks that the value is a two-number tuple. It does not validate that the point falls within the configured display dimensions.
See
ComputerUseLeftClickActionfor performing a single left click
Signature
declare const ComputerUseDoubleClickAction: Struct<{
readonly action: Literal<"double_click">;
readonly coordinate: optionalKey<Tuple<readonly [Int, Int]>>;
}>;ComputerUseHoldKeyAction
Keeps a key pressed for a specified duration during computer-use execution.
When to use
Use to keep a keyboard key depressed for a fixed number of seconds in a computer-use action sequence.
Details
The schema describes objects with action: "hold_key", a text field containing the key to hold, and a duration field containing the number of seconds to hold it.
Gotchas
The schema only checks that duration is a number; it does not require a positive value.
See
ComputerUseKeyActionfor pressing a key or key combination without holding itComputerUseWaitActionfor pausing between actions without holding a key
Signature
declare const ComputerUseHoldKeyAction: Struct<{
readonly action: Literal<"hold_key">;
readonly duration: Finite;
readonly text: String;
}>;ComputerUseKeyAction
Schema for a computer-use action that presses a key or key combination, such as "Return", "ctrl+c", or "ctrl+s".
When to use
Use when validating or constructing a computer-use action for keyboard shortcuts or non-text key presses.
See
TypeActionfor entering ordinary text stringsComputerUseHoldKeyActionfor holding a key for a duration
Signature
declare const ComputerUseKeyAction: Struct<{
readonly action: Literal<"key">;
readonly text: String;
}>;ComputerUseLeftClickAction
Schema for a computer-use action that performs a left click.
When to use
Use to validate or construct an Anthropic computer-use payload for clicking once at the current mouse position or at a specific screen coordinate.
Details
The encoded payload uses action: "left_click". The optional coordinate field supplies the [x, y] pixel position; when omitted, the action uses the current mouse position.
Gotchas
The coordinate schema only checks that the value is a two-number tuple. It does not validate that the point falls within the configured display dimensions.
See
ComputerUseDoubleClickActionfor performing a double clickComputerUseMouseMoveActionfor moving the mouse without clicking
Signature
declare const ComputerUseLeftClickAction: Struct<{
readonly action: Literal<"left_click">;
readonly coordinate: optionalKey<Tuple<readonly [Int, Int]>>;
}>;ComputerUseLeftClickDragAction
Schema for a computer-use action that drags with the left mouse button.
When to use
Use to validate or construct an Anthropic computer-use payload for dragging from one screen coordinate to another in a single action.
Details
The encoded payload uses action: "left_click_drag" and requires both start_coordinate and coordinate as [x, y] pixel positions.
Gotchas
The coordinate schema only checks that each value is a two-number tuple. It does not validate that either point falls within the configured display dimensions.
See
ComputerUseLeftMouseDownActionfor starting a manual drag sequenceComputerUseLeftMouseUpActionfor ending a manual drag sequence
Signature
declare const ComputerUseLeftClickDragAction: Struct<{
readonly action: Literal<"left_click_drag">;
readonly coordinate: Tuple<readonly [Int, Int]>;
readonly start_coordinate: Tuple<readonly [Int, Int]>;
}>;ComputerUseLeftMouseDownAction
Starts a left mouse button press without releasing it.
When to use
Use when constructing a manual click or drag sequence that should press and hold the left mouse button before a later release.
Signature
declare const ComputerUseLeftMouseDownAction: Struct<{
readonly action: Literal<"left_mouse_down">;
readonly coordinate: optionalKey<Tuple<readonly [Int, Int]>>;
}>;ComputerUseLeftMouseUpAction
Releases the left mouse button.
When to use
Use when constructing a manual click or drag sequence that should release the left mouse button after it was previously held down.
Signature
declare const ComputerUseLeftMouseUpAction: Struct<{
readonly action: Literal<"left_mouse_up">;
readonly coordinate: optionalKey<Tuple<readonly [Int, Int]>>;
}>;ComputerUseMiddleClickAction
Schema for a computer-use action that performs a middle click.
When to use
Use to validate or construct a middle-button click action for Anthropic computer use, optionally targeting a specific screen coordinate.
Details
The payload must use action: "middle_click". When coordinate is omitted, the click occurs at the current mouse position.
Gotchas
This action is available in the 2025-01-24 computer-use action set and later; it is not part of ComputerUse_20241022.
See
ComputerUse_20250124for the provider-defined tool version that first accepts this actionComputerUseLeftClickActionfor primary-button clicksComputerUseRightClickActionfor secondary-button clicks
Signature
declare const ComputerUseMiddleClickAction: Struct<{
readonly action: Literal<"middle_click">;
readonly coordinate: optionalKey<Tuple<readonly [Int, Int]>>;
}>;ComputerUseMouseMoveAction
Schema for a computer-use action that moves the mouse cursor to a required [x, y] screen coordinate.
When to use
Use to validate or construct a mouse movement action for an Anthropic computer-use tool call.
Details
The encoded payload has action "mouse_move" and a required coordinate field containing the target [x, y] pixel position.
Gotchas
The coordinate schema only checks that the value is a two-number tuple. It does not validate that the point falls within the configured display dimensions.
Signature
declare const ComputerUseMouseMoveAction: Struct<{
readonly action: Literal<"mouse_move">;
readonly coordinate: Tuple<readonly [Int, Int]>;
}>;ComputerUseRightClickAction
Schema for a computer-use action that performs a right click, optionally at a specific screen coordinate.
When to use
Use to validate or construct the right_click action for an Anthropic computer-use tool call.
Details
The optional coordinate field is an [x, y] screen coordinate in pixels. When omitted, the right click is performed at the current mouse position.
See
ComputerUse_20250124for the provider-defined computer-use tool version that introduced this actionComputerUseLeftClickActionfor the corresponding left-click actionComputerUseMiddleClickActionfor the corresponding middle-click action
Signature
declare const ComputerUseRightClickAction: Struct<{
readonly action: Literal<"right_click">;
readonly coordinate: optionalKey<Tuple<readonly [Int, Int]>>;
}>;ComputerUseScreenshotAction
Schema for a computer-use action that requests a screenshot of the current display.
When to use
Use to validate or construct a computer-use tool action that asks the handler to capture the full current display.
Details
The payload contains only action: "screenshot" and does not include coordinates or other options.
See
ComputerUseZoomActionfor requesting a zoomed-in screenshot of a specific screen region with the 2025-11-24 computer-use tool
Signature
declare const ComputerUseScreenshotAction: Struct<{
readonly action: Literal<"screenshot">;
}>;ComputerUseScrollAction
Schema for a computer-use scroll action.
When to use
Use when validating or constructing Anthropic computer-use scroll payloads.
Details
The encoded payload uses action: "scroll", an optional coordinate, scroll_direction, and scroll_amount.
Gotchas
coordinate only checks a two-number tuple, and scroll_amount is only Schema.Int.
See
ComputerUse_20250124for the tool version that accepts this actionScrollDirectionfor the accepted direction literals
Signature
declare const ComputerUseScrollAction: Struct<{
readonly action: Literal<"scroll">;
readonly coordinate: optionalKey<Tuple<readonly [Int, Int]>>;
readonly scroll_amount: Int;
readonly scroll_direction: Literals<readonly ["up", "down", "left", "right"]>;
}>;ComputerUseTripleClickAction
Schema for a computer-use triple-click action.
When to use
Use when validating or constructing Anthropic computer-use triple-click payloads at the current pointer position or an optional coordinate.
Details
The encoded payload uses action: "triple_click" and an optional coordinate.
Gotchas
coordinate only validates as a two-number tuple and does not check display bounds.
See
ComputerUse_20250124for the tool version that accepts this actionComputerUseDoubleClickActionfor the two-click variantComputerUseLeftClickActionfor a single left click
Signature
declare const ComputerUseTripleClickAction: Struct<{
readonly action: Literal<"triple_click">;
readonly coordinate: optionalKey<Tuple<readonly [Int, Int]>>;
}>;ComputerUseWaitAction
Schema for a computer-use wait action.
When to use
Use when validating or constructing Anthropic computer-use payloads that pause between actions.
Details
The encoded payload uses action: "wait" and a required duration in seconds.
Gotchas
duration is only Schema.Finite; it is not constrained to positive values.
See
ComputerUseHoldKeyActionfor another duration-based computer-use actionComputerUse_20250124for the tool version that accepts this action
Signature
declare const ComputerUseWaitAction: Struct<{
readonly action: Literal<"wait">;
readonly duration: Finite;
}>;ComputerUseZoomAction
Zooms into a specific region of the screen at full resolution.
When to use
Use when building or validating the 2025-11-24 computer-use action for a zoom-enabled tool definition.
Details
The encoded payload uses action: "zoom" and a region tuple.
Gotchas
Requires enableZoom: true in the tool definition. region is only a four-number tuple and does not validate corner ordering or display bounds.
See
ComputerUse_20251124for the tool version that accepts this actionComputerUseScreenshotActionfor capturing the full screen instead
Signature
declare const ComputerUseZoomAction: Struct<{
readonly action: Literal<"zoom">;
readonly region: Tuple<readonly [Int, Int, Int, Int]>;
}>;Coordinate
Schema for an [x, y] screen coordinate in pixels.
When to use
Use when validating computer-use action payloads that carry a single screen position and provider-side bounds checks remain acceptable.
Details
This is a two-number tuple used by computer-use actions that accept screen positions.
Gotchas
This schema validates tuple shape only and does not check display bounds.
Signature
declare const Coordinate: Tuple<readonly [Int, Int]>;MemoryCreateCommand
Schema for the memory tool command that creates a new file at a path.
Details
The payload contains command: "create", a path string, and the file_text content to write to the file.
Signature
declare const MemoryCreateCommand: Struct<{
readonly command: Literal<"create">;
readonly file_text: String;
readonly path: String;
}>;MemoryDeleteCommand
Schema for a memory command that deletes a file or directory.
Signature
declare const MemoryDeleteCommand: Struct<{
readonly command: Literal<"delete">;
readonly path: String;
}>;MemoryInsertCommand
Schema for the memory insert command.
When to use
Use when validating or constructing insert payloads for Memory_20250818.
Details
The payload is discriminated by command: "insert" and requires path, insert_line, and insert_text.
See
Memory_20250818for the provider-defined tool that consumes this commandMemoryStrReplaceCommandfor replacing existing text instead
Signature
declare const MemoryInsertCommand: Struct<{
readonly command: Literal<"insert">;
readonly insert_line: Int;
readonly insert_text: String;
readonly path: String;
}>;MemoryRenameCommand
Schema for the memory command that renames or moves a file or directory.
Details
The payload uses command: "rename" and requires old_path as the current path plus new_path as the new destination path.
Signature
declare const MemoryRenameCommand: Struct<{
readonly command: Literal<"rename">;
readonly new_path: String;
readonly old_path: String;
}>;MemoryStrReplaceCommand
Schema for the memory str_replace command.
When to use
Use when validating or constructing str_replace payloads for Memory_20250818.
Details
The payload is discriminated by command: "str_replace" and requires path, old_str, and new_str.
See
Memory_20250818for the provider-defined tool that consumes this command
Signature
declare const MemoryStrReplaceCommand: Struct<{
readonly command: Literal<"str_replace">;
readonly new_str: String;
readonly old_str: String;
readonly path: String;
}>;MemoryViewCommand
Shows directory contents or file contents with optional line ranges.
Details
When used on a file, returns file contents optionally limited by view_range. When used on a directory, lists contents.
Signature
declare const MemoryViewCommand: Struct<{
readonly command: Literal<"view">;
readonly path: String;
readonly view_range: optionalKey<Tuple<readonly [Int, Int]>>;
}>;ModifierKey
Schema for modifier key literals.
Details
Allowed values are "alt", "ctrl", "meta", and "shift".
Signature
declare const ModifierKey: Literals<readonly ["alt", "ctrl", "meta", "shift"]>;Schema for an [x1, y1, x2, y2] screen region in pixels.
When to use
Use when validating computer-use action payloads that carry a rectangular screen region and provider-side bounds checks remain acceptable.
Details
The tuple represents top-left and bottom-right corners.
Gotchas
This schema validates four numbers only and does not check coordinate ordering or display bounds.
Signature
declare const Region: Tuple<readonly [Int, Int, Int, Int]>;ScrollDirection
Schema for scroll direction literals: "up", "down", "left", or "right".
See
ComputerUseScrollActionfor the action payload that consumes this schema
Signature
declare const ScrollDirection: Literals<readonly ["up", "down", "left", "right"]>;TextEditorCreateCommand
Create a new file with specified content.
When to use
Use when validating or constructing an Anthropic text editor create command.
Details
The payload is discriminated by command: "create" and requires both path and file_text.
Gotchas
Fails if the file already exists. Parent directories must exist.
Signature
declare const TextEditorCreateCommand: Struct<{
readonly command: Literal<"create">;
readonly file_text: String;
readonly path: String;
}>;TextEditorInsertCommand
Inserts text at a specific line number in a file.
Details
Inserts the new text after the specified line number. Use 0 to insert at the beginning of the file; other values are 1-indexed.
Signature
declare const TextEditorInsertCommand: Struct<{
readonly command: Literal<"insert">;
readonly insert_line: Int;
readonly new_str: String;
readonly path: String;
}>;TextEditorStrReplaceCommand
Replaces a specific string in a file with a new string.
When to use
Use when validating or constructing standalone Anthropic text editor str_replace commands.
Details
The payload uses command: "str_replace", path, old_str, and new_str. new_str may be empty to delete text.
Gotchas
The old_str must match exactly (including whitespace and indentation) and must be unique in the file.
See
TextEditorViewCommandfor reading contents before choosingold_strCodeExecutionTextEditorStrReplacefor the code-execution variant
Signature
declare const TextEditorStrReplaceCommand: Struct<{
readonly command: Literal<"str_replace">;
readonly new_str: String;
readonly old_str: String;
readonly path: String;
}>;TextEditorUndoEditCommand
Undoes the last edit made to a file.
Details
Reverts the most recent str_replace, insert, or create operation on the file.
Gotchas
This command is available in text_editor_20241022 and text_editor_20250124, but not in text_editor_20250429 or text_editor_20250728.
Signature
declare const TextEditorUndoEditCommand: Struct<{
readonly command: Literal<"undo_edit">;
readonly path: String;
}>;TextEditorViewCommand
Reads the contents of a file or lists directory contents.
When to use
Use when validating or constructing the standalone Anthropic Text Editor view command.
Details
When used on a file, returns the file contents, optionally limited to a line range. When used on a directory, lists all files and subdirectories. view_range is a 1-indexed [start, end] tuple where -1 means through the end of the file.
See
CodeExecutionTextEditorViewfor the code-execution variant withoutview_range
Signature
declare const TextEditorViewCommand: Struct<{
readonly command: Literal<"view">;
readonly path: String;
readonly view_range: optionalKey<Tuple<readonly [Int, Int]>>;
}>;ToolSearchBM25Parameters
Defines input parameters for BM25/natural language tool search.
When to use
Use when validating or constructing the natural-language query payload for ToolSearchBM25_20251119.
Details
The payload contains Claude's natural-language query. BM25 searches tool names, descriptions, argument names, and argument descriptions.
See
ToolSearchBM25_20251119for the provider-defined tool that consumes these parameters
Signature
declare const ToolSearchBM25Parameters: Struct<{
readonly query: String;
}>;ToolSearchRegexParameters
Schema for regex-based tool search input parameters.
Details
Claude constructs regex patterns using Python's re.search() syntax. Maximum query length: 200 characters.
Signature
declare const ToolSearchRegexParameters: Struct<{
readonly query: String;
}>;TypeAction
Schema for a computer-use action that enters text.
When to use
Use to validate or construct a computer-use action for entering ordinary text strings.
Details
The payload uses action: "type" and a text string containing the text to enter.
See
ComputerUseKeyActionfor key presses and keyboard shortcuts
Signature
declare const TypeAction: Struct<{
readonly action: Literal<"type">;
readonly text: String;
}>;Defines a [start, end] line range for viewing file contents.
When to use
Use when constructing or validating view_range for memory or text editor view commands.
Details
Lines are 1-indexed. Use -1 for end to read to the end of the file. For example, [1, 50] views lines 1-50 and [100, -1] views from line 100 to the end of the file.
See
MemoryViewCommandfor memory view payloads that use this rangeTextEditorViewCommandfor text editor view payloads that use this range
Signature
declare const ViewRange: Tuple<readonly [Int, Int]>;WebFetch_20250910_Args
Defines configuration arguments for the web fetch tool.
When to use
Use when you need to configure WebFetch_20250910 with usage limits, domain filters, citations, or content token limits.
Details
The payload can set maxUses, domain filters, citations, and maxContentTokens, which map to Anthropic web fetch request fields.
Gotchas
allowedDomains and blockedDomains are mutually exclusive. maxContentTokens is approximate and does not apply to binary content such as PDFs.
See
WebFetch_20250910for the provider-defined tool that consumes these argumentsWebFetchCitationsConfigfor configuring citations
Signature
declare const WebFetch_20250910_Args: Struct<{
readonly allowedDomains: optional<$Array<String>>;
readonly blockedDomains: optional<$Array<String>>;
readonly citations: optional<
Struct<{
readonly enabled: Boolean;
}>
>;
readonly maxContentTokens: optional<Int>;
readonly maxUses: optional<Int>;
}>;WebFetchCitationsConfig
Defines citation configuration for web fetch.
When to use
Use when you need to enable or disable citations on web fetch results.
Details
The payload contains the enabled flag. citations is optional on WebFetch_20250910_Args, and citations are disabled by default.
See
WebFetch_20250910_Argsfor the argument schema that consumes this configuration
Signature
declare const WebFetchCitationsConfig: Struct<{
readonly enabled: Boolean;
}>;WebFetchParameters
Schema for Claude-supplied web fetch parameters.
When to use
Use when validating or constructing the url payload consumed by WebFetch_20250910.
Details
The payload contains the single url parameter for Anthropic web fetch.
Gotchas
The URL must be user-provided or from prior search/fetch results. Maximum URL length is 250 characters.
See
WebFetch_20250910for the provider-defined tool that consumes this payload
Signature
declare const WebFetchParameters: Struct<{
readonly url: String;
}>;WebSearch_20250305_Args
Defines configuration arguments for the web search tool.
When to use
Use when you need to configure WebSearch_20250305 with search limits, domain filters, or user location.
Details
The payload can set maxUses, allowedDomains, blockedDomains, and userLocation.
Gotchas
allowedDomains and blockedDomains are mutually exclusive.
See
WebSearch_20250305for the provider-defined tool that consumes these argumentsWebSearchUserLocationfor localizing search results
Signature
declare const WebSearch_20250305_Args: Struct<{
readonly allowedDomains: optional<$Array<String>>;
readonly blockedDomains: optional<$Array<String>>;
readonly maxUses: optional<Int>;
readonly userLocation: optional<
Struct<{
readonly city: optional<String>;
readonly country: optional<String>;
readonly region: optional<String>;
readonly timezone: optional<String>;
readonly type: Literal<"approximate">;
}>
>;
}>;WebSearchParameters
Schema for Claude-supplied web search tool parameters.
Details
The payload contains the generated query string and is consumed by WebSearch_20250305.
See
WebSearch_20250305for the provider-defined tool that consumes this payload
Signature
declare const WebSearchParameters: Struct<{
readonly query: String;
}>;WebSearchUserLocation
Describes user location for localizing search results.
When to use
Use when you need to localize search results for location-dependent queries like weather, local businesses, or events.
Details
The schema uses type: "approximate" plus optional city, region, country, and timezone. country is an ISO 3166-1 alpha-2 code, and timezone is an IANA time zone identifier.
See
WebSearch_20250305_Argsfor the argument schema that consumes this location
Signature
declare const WebSearchUserLocation: Struct<{
readonly city: optional<String>;
readonly country: optional<String>;
readonly region: optional<String>;
readonly timezone: optional<String>;
readonly type: Literal<"approximate">;
}>;Tools
Bash_20241022
Defines the Anthropic Bash tool (2024-10-22 version).
When to use
Use when you want the model to execute bash commands with the 2024-10-22 Anthropic computer-use beta.
Details
Allows the model to execute bash commands in a sandboxed environment. Requires the "computer-use-2024-10-22" beta header.
See
Bash_20250124for the newer 2025-01-24 version of the bash tool
Signature
declare const Bash_20241022: <Mode extends FailureMode | undefined = undefined>(args: {
readonly failureMode?: Mode;
}) => ProviderDefined<
"anthropic.bash_20241022",
"AnthropicBash",
{
readonly args: Void;
readonly failure: Never;
readonly failureMode: Mode extends undefined ? "error" : Mode;
readonly parameters: Struct;
readonly success: String;
},
true
>;Bash_20250124
Defines the Anthropic Bash tool (2025-01-24 version).
When to use
Use when you want the model to execute bash commands with the 2025-01-24 Anthropic computer-use beta.
Details
Allows the model to execute bash commands in a sandboxed environment. Requires the "computer-use-2025-01-24" beta header.
See
Bash_20241022for the older 2024-10-22 version of the bash tool
Signature
declare const Bash_20250124: <Mode extends FailureMode | undefined = undefined>(args: {
readonly failureMode?: Mode;
}) => ProviderDefined<
"anthropic.bash_20250124",
"AnthropicBash",
{
readonly args: Void;
readonly failure: Never;
readonly failureMode: Mode extends undefined ? "error" : Mode;
readonly parameters: Struct;
readonly success: String;
},
true
>;CodeExecution_20250522
Defines the Anthropic Code Execution tool (2025-05-22 version).
When to use
Use when you want the model to execute code in a sandboxed environment with the 2025-05-22 Anthropic code-execution beta.
Details
Allows the model to execute code in a sandboxed environment with support for multiple execution types including programmatic tool calls, bash execution, and text editor operations.
See
CodeExecutionProgrammaticToolCallfor the programmatic tool call schema
Signature
declare const CodeExecution_20250522: <Mode extends FailureMode | undefined = undefined>(
args: void,
) => ProviderDefined<
"anthropic.code_execution_20250522",
"AnthropicCodeExecution",
{
readonly args: Void;
readonly failure: Struct;
readonly failureMode: Mode extends undefined ? "error" : Mode;
readonly parameters: Union;
readonly success: Struct;
},
false
>;CodeExecution_20250825
Defines the Anthropic Code Execution tool (2025-08-25 version).
When to use
Use when you want the model to execute code in a sandboxed environment with the 2025-08-25 Anthropic code-execution beta.
Details
Requires the code-execution-2025-08-25 beta header and uses CodeExecution_20250825_Parameters as its input schema.
See
CodeExecution_20250522for the older 2025-05-22 code execution toolCodeExecution_20250825_Parametersfor the input schema consumed by this tool
Signature
declare const CodeExecution_20250825: <Mode extends FailureMode | undefined = undefined>(
args: void,
) => ProviderDefined<
"anthropic.code_execution_20250825",
"AnthropicCodeExecution",
{
readonly args: Void;
readonly failure: Union;
readonly failureMode: Mode extends undefined ? "error" : Mode;
readonly parameters: Struct;
readonly success: Union;
},
false
>;ComputerUse_20241022
Defines the deprecated computer-use tool for Claude 3.5 Sonnet v2.
Details
Requires the "computer-use-2024-10-22" beta header. Basic actions only: screenshot, left_click, type, key, mouse_move.
Signature
declare const ComputerUse_20241022: <Mode extends FailureMode | undefined = undefined>(args: {
readonly displayHeightPx: number;
readonly displayNumber?: number;
readonly displayWidthPx: number;
readonly failureMode?: Mode;
}) => ProviderDefined<
"anthropic.computer_use_20241022",
"AnthropicComputerUse",
{
readonly args: Struct;
readonly failure: Never;
readonly failureMode: Mode extends undefined ? "error" : Mode;
readonly parameters: Union;
readonly success: String;
},
true
>;ComputerUse_20250124
Defines the computer-use tool for Claude 4 models and Claude Sonnet 3.7.
When to use
Use when you need Anthropic computer use for Claude 4 models or Claude Sonnet 3.7 with the 2025-01-24 action set.
Details
Requires the "computer-use-2025-01-24" beta header. Includes basic actions plus enhanced actions: scroll, left_click_drag, right_click, middle_click, double_click, triple_click, left_mouse_down, left_mouse_up, hold_key, wait.
See
ComputerUse_20241022for the older basic action setComputerUse_20251124for the newer zoom-capable version
Signature
declare const ComputerUse_20250124: <Mode extends FailureMode | undefined = undefined>(args: {
readonly displayHeightPx: number;
readonly displayNumber?: number;
readonly displayWidthPx: number;
readonly failureMode?: Mode;
}) => ProviderDefined<
"anthropic.computer_20250124",
"AnthropicComputerUse",
{
readonly args: Struct;
readonly failure: Never;
readonly failureMode: Mode extends undefined ? "error" : Mode;
readonly parameters: Union;
readonly success: String;
},
true
>;ComputerUse_20251124
Defines the computer-use tool for Claude Opus 4.5 only.
When to use
Use when you need Anthropic computer use for Claude Opus 4.5 with the 2025-11-24 action set and zoom-capable screen inspection.
Details
Requires the "computer-use-2025-11-24" beta header. Includes all actions from computer_20250124 plus the zoom action for detailed screen region inspection.
Gotchas
Zoom actions require enableZoom: true in args.
See
ComputerUse_20250124for the previous action set without zoomComputerUseZoomActionfor the zoom action payload
Signature
declare const ComputerUse_20251124: <Mode extends FailureMode | undefined = undefined>(args: {
readonly displayHeightPx: number;
readonly displayNumber?: number;
readonly displayWidthPx: number;
readonly enableZoom?: boolean;
readonly failureMode?: Mode;
}) => ProviderDefined<
"anthropic.computer_20251124",
"AnthropicComputerUse",
{
readonly args: Struct;
readonly failure: Never;
readonly failureMode: Mode extends undefined ? "error" : Mode;
readonly parameters: Union;
readonly success: String;
},
true
>;Memory_20250818
Defines the memory tool for persistent file operations across conversations.
Details
Provides commands for creating, viewing, editing, renaming, and deleting files within the model's memory space.
Signature
declare const Memory_20250818: <Mode extends FailureMode | undefined = undefined>(args: {
readonly failureMode?: Mode;
}) => ProviderDefined<
"anthropic.memory_20250818",
"AnthropicMemory",
{
readonly args: Void;
readonly failure: Never;
readonly failureMode: Mode extends undefined ? "error" : Mode;
readonly parameters: Union;
readonly success: String;
},
true
>;TextEditor_20241022
Defines the deprecated text editor tool for Claude 3.5 Sonnet.
When to use
Use when you need the 2024-10-22 str_replace_editor compatibility path for Claude 3.5 Sonnet.
Details
Requires the "computer-use-2024-10-22" beta header and supports view, create, str_replace, insert, and undo_edit commands.
See
TextEditor_20250124for the newerstr_replace_editorversionTextEditor_20250728for the Claude 4str_replace_based_edit_toolline
Signature
declare const TextEditor_20241022: <Mode extends FailureMode | undefined = undefined>(args: {
readonly failureMode?: Mode;
}) => ProviderDefined<
"anthropic.text_editor_20241022",
"AnthropicTextEditor",
{
readonly args: Void;
readonly failure: Never;
readonly failureMode: Mode extends undefined ? "error" : Mode;
readonly parameters: Union;
readonly success: String;
},
true
>;TextEditor_20250124
Defines the text editor tool for deprecated Claude Sonnet 3.7.
When to use
Use when you need the 2025-01-24 Claude Sonnet 3.7 text editor tool using str_replace_editor.
Details
Requires the "computer-use-2025-01-24" beta header, requires a handler, and supports view, create, str_replace, insert, and undo_edit commands.
See
TextEditor_20241022for the olderstr_replace_editorversionTextEditor_20250429for the Claude 4str_replace_based_edit_toolline
Signature
declare const TextEditor_20250124: <Mode extends FailureMode | undefined = undefined>(args: {
readonly failureMode?: Mode;
}) => ProviderDefined<
"anthropic.text_editor_20250124",
"AnthropicTextEditor",
{
readonly args: Void;
readonly failure: Never;
readonly failureMode: Mode extends undefined ? "error" : Mode;
readonly parameters: Union;
readonly success: String;
},
true
>;TextEditor_20250429
Defines the text editor tool for Claude 4 models using Anthropic's str_replace_based_edit_tool.
When to use
Use when you need the 2025-04-29 Claude 4 str_replace_based_edit_tool version.
Details
Requires the "computer-use-2025-01-24" beta header.
Gotchas
This version does not support the undo_edit command.
See
TextEditor_20250124for the previousstr_replace_editorversionTextEditor_20250728for the later Claude 4 text editor version
Signature
declare const TextEditor_20250429: <Mode extends FailureMode | undefined = undefined>(args: {
readonly failureMode?: Mode;
readonly max_characters?: number;
}) => ProviderDefined<
"anthropic.text_editor_20250429",
"AnthropicTextEditor",
{
readonly args: Struct;
readonly failure: Never;
readonly failureMode: Mode extends undefined ? "error" : Mode;
readonly parameters: Union;
readonly success: String;
},
true
>;TextEditor_20250728
Defines the text editor tool for Claude 4 models.
Details
Uses Anthropic's str_replace_based_edit_tool. max_characters can limit file-view output for this version.
Gotchas
This version does not support the undo_edit command.
Signature
declare const TextEditor_20250728: <Mode extends FailureMode | undefined = undefined>(args: {
readonly failureMode?: Mode;
readonly max_characters?: number;
}) => ProviderDefined<
"anthropic.text_editor_20250728",
"AnthropicTextEditor",
{
readonly args: Struct;
readonly failure: Never;
readonly failureMode: Mode extends undefined ? "error" : Mode;
readonly parameters: Union;
readonly success: String;
},
true
>;ToolSearchBM25_20251119
Defines BM25/natural language tool search for Claude models.
When to use
Use when you want Claude to find relevant tools from a natural-language query instead of a regex pattern.
Details
Claude uses natural language queries to search for tools using the BM25 algorithm. The search is performed against tool names, descriptions, argument names, and argument descriptions. Requires the "advanced-tool-use-2025-11-20" beta header.
See
ToolSearchRegex_20251119for the regex-pattern alternative
Signature
declare const ToolSearchBM25_20251119: <Mode extends FailureMode | undefined = undefined>(
args: void,
) => ProviderDefined<
"anthropic.tool_search_tool_bm25_20251119",
"AnthropicToolSearchBM25",
{
readonly args: Void;
readonly failure: Struct;
readonly failureMode: Mode extends undefined ? "error" : Mode;
readonly parameters: Struct;
readonly success: $Array;
},
false
>;ToolSearchRegex_20251119
Defines regex-based tool search for Claude models.
Details
Claude constructs regex patterns using Python's re.search() syntax to find tools. The regex is matched against tool names, descriptions, argument names, and argument descriptions. Requires the "advanced-tool-use-2025-11-20" beta header.
Signature
declare const ToolSearchRegex_20251119: <Mode extends FailureMode | undefined = undefined>(
args: void,
) => ProviderDefined<
"anthropic.tool_search_tool_regex_20251119",
"AnthropicToolSearchRegex",
{
readonly args: Void;
readonly failure: Struct;
readonly failureMode: Mode extends undefined ? "error" : Mode;
readonly parameters: Struct;
readonly success: $Array;
},
false
>;WebFetch_20250910
Defines the web fetch tool for Claude models.
When to use
Use when you want Claude to retrieve the content of a specific web page or PDF.
Details
Allows Claude to retrieve full content from web pages and PDF documents. This is a server-side tool executed by Anthropic's infrastructure. Selecting this tool adds the "web-fetch-2025-09-10" beta header.
See
WebSearch_20250305for discovering URLs before fetching specific content
Signature
declare const WebFetch_20250910: <Mode extends FailureMode | undefined = undefined>(args: {
readonly allowedDomains?: readonly Array<string>;
readonly blockedDomains?: readonly Array<string>;
readonly citations?: ReadonlySide<{
readonly enabled: Boolean;
}, "Encoded">;
readonly maxContentTokens?: number;
readonly maxUses?: number;
}) => ProviderDefined<"anthropic.web_fetch_20250910", "AnthropicWebFetch", {
readonly args: Struct;
readonly failure: Struct;
readonly failureMode: Mode extends undefined ? "error" : Mode;
readonly parameters: Struct;
readonly success: Struct;
}, false>WebSearch_20250305
Defines the web search tool for Claude models.
When to use
Use when you want Claude to search the web for real-time information.
Details
Enables Claude to search the web for real-time information. This is a server-side tool executed by Anthropic's infrastructure. Generally available (no beta header required).
See
WebFetch_20250910for retrieving known URLs after discovery
Signature
declare const WebSearch_20250305: <Mode extends FailureMode | undefined = undefined>(args: {
readonly allowedDomains?: readonly Array<string>;
readonly blockedDomains?: readonly Array<string>;
readonly maxUses?: number;
readonly userLocation?: {
readonly city?: string;
readonly country?: string;
readonly region?: string;
readonly timezone?: string;
readonly type: "approximate";
};
}) => ProviderDefined<"anthropic.web_search_20250305", "AnthropicWebSearch", {
readonly args: Struct;
readonly failure: Struct;
readonly failureMode: Mode extends undefined ? "error" : Mode;
readonly parameters: Struct;
readonly success: $Array;
}, false>
Union of all Anthropic provider-defined tool definitions exported by this module.
When to use
Use when a helper, collection, or option accepts any Anthropic provider-defined tool value created by this module.
Details
The union is built from the return types of the exported constructors, including Bash, Code Execution, Computer Use, Memory, Text Editor, Tool Search, Web Fetch, and Web Search tool versions.