ToolConfig Class

  • java.lang.Object
    • com.azure.ai.agents.models.ToolConfig

Implements

public final class ToolConfig
implements JsonSerializable<ToolConfig>

Per-tool configuration that controls tool visibility and search behavior.

Constructor Summary

Constructor Description
ToolConfig()

Creates an instance of ToolConfig class.

Method Summary

Modifier and Type Method and Description
static ToolConfig fromJson(JsonReader jsonReader)

Reads an instance of ToolConfig from the JsonReader.

String getAdditionalSearchText()

Get the additionalSearchText property: Additional text indexed for tool_search.

Boolean isPin()

Get the pin property: When true, the tool is always included in agent context and visible in `tools/list`.

ToolConfig setAdditionalSearchText(String additionalSearchText)

Set the additionalSearchText property: Additional text indexed for tool_search.

ToolConfig setPin(Boolean pin)

Set the pin property: When true, the tool is always included in agent context and visible in `tools/list`.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

ToolConfig

public ToolConfig()

Creates an instance of ToolConfig class.

Method Details

fromJson

public static ToolConfig fromJson(JsonReader jsonReader)

Reads an instance of ToolConfig from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of ToolConfig if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the ToolConfig.

getAdditionalSearchText

public String getAdditionalSearchText()

Get the additionalSearchText property: Additional text indexed for tool_search. Supplements the native tool description to improve discoverability. Does not alter `tools/list` output.

Returns:

the additionalSearchText value.

isPin

public Boolean isPin()

Get the pin property: When true, the tool is always included in agent context and visible in `tools/list`. When false (default), the tool is hidden from `tools/list` and only discoverable via `tool_search`.

Returns:

the pin value.

setAdditionalSearchText

public ToolConfig setAdditionalSearchText(String additionalSearchText)

Set the additionalSearchText property: Additional text indexed for tool_search. Supplements the native tool description to improve discoverability. Does not alter `tools/list` output.

Parameters:

additionalSearchText - the additionalSearchText value to set.

Returns:

the ToolConfig object itself.

setPin

public ToolConfig setPin(Boolean pin)

Set the pin property: When true, the tool is always included in agent context and visible in `tools/list`. When false (default), the tool is hidden from `tools/list` and only discoverable via `tool_search`.

Parameters:

pin - the pin value to set.

Returns:

the ToolConfig object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to