MCPcopy Index your code
hub / github.com/docker/docker-agent / handleTransferTask

Method handleTransferTask

cmd/wasm/runtime_wasm.go:716–731  ·  view source on GitHub ↗

handleTransferTask processes the transfer_task tool call.

(tc tools.ToolCall)

Source from the content-addressed store, hash-verified

714
715// handleTransferTask processes the transfer_task tool call.
716func (rt *wasmRuntime) handleTransferTask(tc tools.ToolCall) (string, string) {
717 var params struct {
718 Agent string `json:"agent"`
719 Task string `json:"task"`
720 ExpectedOutput string `json:"expected_output"`
721 }
722 if err := json.Unmarshal([]byte(tc.Function.Arguments), &params); err != nil {
723 return fmt.Sprintf("Invalid arguments: %v", err), ""
724 }
725
726 if _, ok := rt.agents[params.Agent]; !ok {
727 return fmt.Sprintf("Agent %q not found", params.Agent), ""
728 }
729
730 return fmt.Sprintf("Task transferred to %s: %s", params.Agent, params.Task), params.Agent
731}
732
733// handleHandoff processes the handoff tool call.
734func (rt *wasmRuntime) handleHandoff(tc tools.ToolCall) (string, string) {

Callers 1

processToolCallsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected