Problem
The @anthropic-ai/vertex-sdk package lacks TypeScript type definitions for the Tool Search functionality (tool_search_tool_regex_20251119 and tool_search_tool_bm25_20251119), even though the API fully supports these features.
Current Behavior
When using Tool Search tools, TypeScript compilation fails because the types are not defined:
tools: [
{
type: 'tool_search_tool_regex_20251119', // TypeScript error: Type '"tool_search_tool_regex_20251119"' is not assignable to type '...'
name: 'tool_search_tool_regex',
} as any, // Forced to use 'as any' workaround
{
name: 'get_weather',
defer_loading: true, // TypeScript error: 'defer_loading' does not exist in type 'Tool'
} as any, // Forced to use 'as any' workaround
]
The defer_loading property on tools also lacks type definition, forcing users to use as any type assertions.
Expected Behavior
The following types should be available:
tool_search_tool_regex_20251119 - Regex-based tool search
tool_search_tool_bm25_20251119 - BM25-based tool search
defer_loading property on Tool type
server_tool_use and tool_search_tool_result content block types in responses
Evidence
The API correctly handles these types at runtime:
const msg = await vertexClient.messages.create({
model: 'claude-sonnet-4-5',
max_tokens: 1000,
messages: [{
role: 'user',
content: [{ type: 'text', text: 'What is the weather in San Francisco?' }],
}],
tools: [
{
type: 'tool_search_tool_regex_20251119',
name: 'tool_search_tool_regex',
} as any,
{
name: 'get_weather',
description: 'Get the weather at a specific location',
input_schema: {
type: 'object',
properties: {
location: { type: 'string' },
unit: { type: 'string', enum: ['celsius', 'fahrenheit'] },
},
required: ['location'],
},
defer_loading: true,
} as any,
],
tool_choice: { type: 'auto' },
});
Runtime response shows Tool Search working correctly:
{
"model": "claude-sonnet-4-5-20250929",
"content": [
{
"type": "text",
"text": "I'll search for weather-related tools..."
},
{
"type": "server_tool_use",
"id": "srvtoolu_vrtx_0166J3cFJdiPG4vLWXa8e5az",
"name": "tool_search_tool_regex",
"input": {}
},
{
"type": "tool_search_tool_result",
"tool_use_id": "srvtoolu_vrtx_0166J3cFJdiPG4vLWXa8e5az",
"content": {}
},
{
"type": "tool_use",
"id": "toolu_vrtx_01QfYyuFYPymZDRJx7KVHEYC",
"name": "get_weather",
"input": {}
}
],
"stop_reason": "tool_use"
}
Environment
@anthropic-ai/vertex-sdk: latest
- TypeScript: 5.x
Problem
The
@anthropic-ai/vertex-sdkpackage lacks TypeScript type definitions for the Tool Search functionality (tool_search_tool_regex_20251119andtool_search_tool_bm25_20251119), even though the API fully supports these features.Current Behavior
When using Tool Search tools, TypeScript compilation fails because the types are not defined:
The
defer_loadingproperty on tools also lacks type definition, forcing users to useas anytype assertions.Expected Behavior
The following types should be available:
tool_search_tool_regex_20251119- Regex-based tool searchtool_search_tool_bm25_20251119- BM25-based tool searchdefer_loadingproperty on Tool typeserver_tool_useandtool_search_tool_resultcontent block types in responsesEvidence
The API correctly handles these types at runtime:
Runtime response shows Tool Search working correctly:
{ "model": "claude-sonnet-4-5-20250929", "content": [ { "type": "text", "text": "I'll search for weather-related tools..." }, { "type": "server_tool_use", "id": "srvtoolu_vrtx_0166J3cFJdiPG4vLWXa8e5az", "name": "tool_search_tool_regex", "input": {} }, { "type": "tool_search_tool_result", "tool_use_id": "srvtoolu_vrtx_0166J3cFJdiPG4vLWXa8e5az", "content": {} }, { "type": "tool_use", "id": "toolu_vrtx_01QfYyuFYPymZDRJx7KVHEYC", "name": "get_weather", "input": {} } ], "stop_reason": "tool_use" }Environment
@anthropic-ai/vertex-sdk: latest