public sealed class Tool : IMessage<Tool>, IEquatable<Tool>, IDeepCloneable<Tool>, IBufferMessage, IMessage
Reference documentation and code samples for the Vertex AI v1beta1 API class Tool.
Tool details that the model may use to generate response.
A Tool is a piece of code that enables the system to interact with
external systems to perform an action, or set of actions, outside of
knowledge and scope of the model. A Tool object should contain exactly
one type of Tool (e.g FunctionDeclaration, Retrieval or
GoogleSearchRetrieval).
public Tool.Types.ComputerUse ComputerUse { get; set; }
Optional. Tool to support the model interacting directly with the computer.
If enabled, it automatically populates computer-use specific Function
Declarations.
public RepeatedField<FunctionDeclaration> FunctionDeclarations { get; }
Optional. Function tool type.
One or more function declarations to be passed to the model along with the
current user query. Model may decide to call a subset of these functions
by populating
[FunctionCall][google.cloud.aiplatform.v1beta1.Part.function_call] in the
response. User should provide a
[FunctionResponse][google.cloud.aiplatform.v1beta1.Part.function_response]
for each function call in the next turn. Based on the function responses,
Model will generate the final response back to the user.
Maximum 128 function declarations can be provided.
Optional. Retrieval tool type.
System will always execute the provided retrieval tool(s) to get external
knowledge to answer the prompt. Retrieval results are presented to the
model for generation.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eTool\u003c/code\u003e class in the Vertex AI v1beta1 API allows models to interact with external systems to perform actions beyond their inherent knowledge.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003eTool\u003c/code\u003e object is designed to contain only one specific type of tool, such as \u003ccode\u003eFunctionDeclaration\u003c/code\u003e, \u003ccode\u003eRetrieval\u003c/code\u003e, or \u003ccode\u003eGoogleSearchRetrieval\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eTool\u003c/code\u003e class implements several interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, and inherits from the \u003ccode\u003eobject\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eTool\u003c/code\u003e class offers various optional tool types, including \u003ccode\u003eCodeExecution\u003c/code\u003e, \u003ccode\u003eEnterpriseWebSearch\u003c/code\u003e, \u003ccode\u003eFunctionDeclarations\u003c/code\u003e, \u003ccode\u003eGoogleSearch\u003c/code\u003e, \u003ccode\u003eGoogleSearchRetrieval\u003c/code\u003e, and \u003ccode\u003eRetrieval\u003c/code\u003e, which extend the model's capabilities.\u003c/p\u003e\n"],["\u003cp\u003eThe FunctionDeclarations property enables the model to call a subset of functions based on the user query and subsequently receive function responses to generate the final output, however, it only allows up to 128 declarations.\u003c/p\u003e\n"]]],[],null,["# Vertex AI v1beta1 API - Class Tool (1.0.0-beta47)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0-beta47 (latest)](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.Tool)\n- [1.0.0-beta46](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/1.0.0-beta46/Google.Cloud.AIPlatform.V1Beta1.Tool) \n\n public sealed class Tool : IMessage\u003cTool\u003e, IEquatable\u003cTool\u003e, IDeepCloneable\u003cTool\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Vertex AI v1beta1 API class Tool.\n\nTool details that the model may use to generate response.\n\nA `Tool` is a piece of code that enables the system to interact with\nexternal systems to perform an action, or set of actions, outside of\nknowledge and scope of the model. A Tool object should contain exactly\none type of Tool (e.g FunctionDeclaration, Retrieval or\nGoogleSearchRetrieval). \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Tool \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Tool](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.Tool), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Tool](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.Tool), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Tool](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.Tool), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.AIPlatform.V1Beta1](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1)\n\nAssembly\n--------\n\nGoogle.Cloud.AIPlatform.V1Beta1.dll\n\nConstructors\n------------\n\n### Tool()\n\n public Tool()\n\n### Tool(Tool)\n\n public Tool(Tool other)\n\nProperties\n----------\n\n### CodeExecution\n\n public Tool.Types.CodeExecution CodeExecution { get; set; }\n\nOptional. CodeExecution tool type.\nEnables the model to execute code as part of generation.\n\n### ComputerUse\n\n public Tool.Types.ComputerUse ComputerUse { get; set; }\n\nOptional. Tool to support the model interacting directly with the computer.\nIf enabled, it automatically populates computer-use specific Function\nDeclarations.\n\n### EnterpriseWebSearch\n\n public EnterpriseWebSearch EnterpriseWebSearch { get; set; }\n\nOptional. Tool to support searching public web data, powered by Vertex AI\nSearch and Sec4 compliance.\n\n### FunctionDeclarations\n\n public RepeatedField\u003cFunctionDeclaration\u003e FunctionDeclarations { get; }\n\nOptional. Function tool type.\nOne or more function declarations to be passed to the model along with the\ncurrent user query. Model may decide to call a subset of these functions\nby populating\n\\[FunctionCall\\]\\[google.cloud.aiplatform.v1beta1.Part.function_call\\] in the\nresponse. User should provide a\n\\[FunctionResponse\\]\\[google.cloud.aiplatform.v1beta1.Part.function_response\\]\nfor each function call in the next turn. Based on the function responses,\nModel will generate the final response back to the user.\nMaximum 128 function declarations can be provided.\n\n### GoogleMaps\n\n public GoogleMaps GoogleMaps { get; set; }\n\nOptional. GoogleMaps tool type.\nTool to support Google Maps in Model.\n\n### GoogleSearch\n\n public Tool.Types.GoogleSearch GoogleSearch { get; set; }\n\nOptional. GoogleSearch tool type.\nTool to support Google Search in Model. Powered by Google.\n\n### GoogleSearchRetrieval\n\n public GoogleSearchRetrieval GoogleSearchRetrieval { get; set; }\n\nOptional. GoogleSearchRetrieval tool type.\nSpecialized retrieval tool that is powered by Google search.\n\n### Retrieval\n\n public Retrieval Retrieval { get; set; }\n\nOptional. Retrieval tool type.\nSystem will always execute the provided retrieval tool(s) to get external\nknowledge to answer the prompt. Retrieval results are presented to the\nmodel for generation.\n\n### UrlContext\n\n public UrlContext UrlContext { get; set; }\n\nOptional. Tool to support URL context retrieval."]]