Interface ToolRequest
- All Superinterfaces:
HasMeta,ServerFeature.Request
An incoming tool call request with the tool name, arguments, and metadata.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault ArgsReturns the arguments for this tool request.static ToolRequest.Builderbuilder()Creates a new builder for constructingToolRequestinstances.default voidcheck()Validates that the tool name is not blank.Returns the input response map from interactive tool calls, ornull.meta()Returns the optional metadata map for protocol extensions.name()Returns the tool name.@Nullable PayloadDeserializerReturns the payload deserializer configured for this request, ornullif not set.@Nullable ProgressTokenThe client's_meta.progressTokenfrom this request, ornullif the client did not opt into progress notifications for this call.@Nullable StringReturns the request state string, ornull.@Nullable Tasktask()The task handle for task-augmented tool calls, ornullfor non-augmented calls.
-
Method Details
-
name
String name()Returns the tool name.- Returns:
- the tool name
-
check
@Check default void check()Validates that the tool name is not blank.- Throws:
IllegalArgumentException- ifnameis blank
-
arguments
Returns the arguments for this tool request.- Returns:
- the tool arguments, or empty if none provided
-
meta
Description copied from interface:HasMetaReturns the optional metadata map for protocol extensions. -
payloadDeserializer
Returns the payload deserializer configured for this request, ornullif not set.Superseded by
arguments(), which already carries the deserializer; this direct accessor may be removed once callers migrate off it.- Returns:
- the payload deserializer, or
null
-
progressToken
@Nullable ProgressToken progressToken()The client's_meta.progressTokenfrom this request, ornullif the client did not opt into progress notifications for this call.- Returns:
- the progress token, or
null
-
inputResponses
Returns the input response map from interactive tool calls, ornull.- Returns:
- the input responses, or
null
-
requestState
@Nullable String requestState()Returns the request state string, ornull.- Returns:
- the request state, or
null
-
task
@Nullable Task task()The task handle for task-augmented tool calls, ornullfor non-augmented calls.- Returns:
- the task handle, or
null
-
builder
Creates a new builder for constructingToolRequestinstances.- Returns:
- a new builder
-