Package com.github.copilot.sdk.json
Interface PreToolUseHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Handler for pre-tool-use hooks.
This hook is called before a tool is executed, allowing you to:
- Approve or deny tool execution
- Modify tool arguments
- Add additional context for the model
- Since:
- 1.0.6
-
Method Summary
Modifier and TypeMethodDescriptionhandle(PreToolUseHookInput input, HookInvocation invocation) Handles a pre-tool-use hook invocation.
-
Method Details
-
handle
CompletableFuture<PreToolUseHookOutput> handle(PreToolUseHookInput input, HookInvocation invocation) Handles a pre-tool-use hook invocation.- Parameters:
input- the hook input containing tool name and argumentsinvocation- context information about the invocation- Returns:
- a future that resolves with the hook output, or
nullto use defaults
-