Package com.github.copilot.sdk.json
Class ToolDef
java.lang.Object
com.github.copilot.sdk.json.ToolDef
Low-level tool definition for JSON-RPC communication.
This is an internal class representing the wire format of a tool. For
registering tools with the SDK, use ToolDefinition instead.
- Since:
- 1.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the tool description.getName()Gets the tool name.Gets the JSON Schema for tool parameters.voidsetDescription(String description) Sets the tool description.voidSets the tool name.voidsetParameters(Object parameters) Sets the JSON Schema for tool parameters.
-
Constructor Details
-
ToolDef
public ToolDef()Creates an empty tool definition. -
ToolDef
Creates a tool definition with all fields.- Parameters:
name- the unique tool identifierdescription- the tool descriptionparameters- the JSON Schema for tool parameters
-
-
Method Details
-
getName
Gets the tool name.- Returns:
- the tool name
-
setName
Sets the tool name.- Parameters:
name- the tool name
-
getDescription
Gets the tool description.- Returns:
- the tool description
-
setDescription
Sets the tool description.- Parameters:
description- the tool description
-
getParameters
Gets the JSON Schema for tool parameters.- Returns:
- the parameters schema
-
setParameters
Sets the JSON Schema for tool parameters.- Parameters:
parameters- the parameters schema
-