Google Vertex Anthropic tools available
Google Vertex Anthropic supports a subset of Anthropic's built-in tools: Bash Tool (for running bash commands), Text Editor Tool (for viewing and editing text files), Computer Tool (for keyboard and mouse control), and Web Search Tool (for real-time web content). Tools like Code Execution, Memory, and Web Fetch are not available.
Google Vertex Anthropic strict mode tool limitation
Google Vertex Anthropic does not support strict mode on tool definitions. Setting strict: true on a tool will be ignored and a warning will be emitted.
Google Vertex Anthropic Bash Tool example
Example of creating a Bash Tool for Google Vertex Anthropic: const bashTool = vertexAnthropic.tools.bash_20250124({ execute: async ({ command, restart }) => { // Implement your bash command execution logic here // Return the result of the command execution }, }); Parameters: command (string, required unless restarting) and restart (boolean, optional).
Google Vertex Anthropic Text Editor Tool example
Example of creating a Text Editor Tool for Google Vertex Anthropic: const textEditorTool = vertexAnthropic.tools.textEditor_20250124({ execute: async ({ command, path, file_text, insert_line, new_str, insert_text, old_str, view_range }) => { // Implement your text editing logic here // Return the result of the text editing operation }, }); Parameters: command (view|create|str_replace|insert|undo_edit), path (string, absolute file/directory path), file_text (string, required for create), insert_line (number, required for insert), new_str (string, for str_replace), insert_text (string, required for insert), old_str (string, required for str_replace), view_range (number[], optional for view).
Google Vertex Anthropic Computer Tool example
Example of creating a Computer Tool for Google Vertex Anthropic: const computerTool = vertexAnthropic.tools.computer_20241022({ displayWidthPx: 1920, displayHeightPx: 1080, displayNumber: 0, execute: async ({ action, coordinate, text }) => { switch (action) { case 'screenshot': { return { type: 'image', data: fs.readFileSync('./data/screenshot-editor.png').toString('base64'), }; } default: { console.log('Action:', action); console.log('Coordinate:', coordinate); console.log('Text:', text); return `executed ${action}`; } } }, toModelOutput({ output }) { return typeof output === 'string' ? [{ type: 'text', text: output }] : [{ type: 'file-data', data: output.data, mediaType: 'image/png' }]; }, }); Parameters: action (key|type|mouse_move|left_click|left_click_drag|right_click|middle_click|double_click|screenshot|cursor_position), coordinate (number[], for mouse_move and left_click_drag), text (string, for type and key).
Google Vertex Anthropic Web Search Tool example
Example of creating a Web Search Tool for Google Vertex Anthropic: const webSearchTool = vertexAnthropic.tools.webSearch_20250305({ maxUses: 5, allowedDomains: ['example.com'], blockedDomains: ['spam.com'], userLocation: { type: 'approximate', city: 'San Francisco', region: 'CA', country: 'US', timezone: 'America/Los_Angeles', }, }); Parameters: maxUses (number, optional), allowedDomains (string[], optional), blockedDomains (string[], optional), userLocation (object with type, city, region, country, timezone fields).