MCPcopy Create free account
hub / github.com/compozy/agh / toolInvokeBundle

Function toolInvokeBundle

internal/cli/tool_operator.go:645–681  ·  view source on GitHub ↗
(response ToolInvokeResponseRecord)

Source from the content-addressed store, hash-verified

643}
644
645func toolInvokeBundle(response ToolInvokeResponseRecord) outputBundle {
646 return outputBundle{
647 jsonValue: response,
648 human: func() (string, error) {
649 rows := []keyValue{
650 {Label: toolOperatorToolIDValue, Value: response.ToolID.String()},
651 {Label: toolOperatorStatusValue, Value: stringOrDash(response.Status)},
652 {Label: "Truncated", Value: formatBool(response.Truncated)},
653 {Label: cliDurationValue, Value: fmt.Sprintf("%dms", response.DurationMS)},
654 {Label: "Bytes", Value: fmt.Sprintf("%d", response.Result.Bytes)},
655 }
656 if preview := strings.TrimSpace(response.Result.Preview); preview != "" {
657 rows = append(rows, keyValue{Label: toolOperatorPreviewValue, Value: preview})
658 }
659 if len(response.Result.Redactions) > 0 {
660 rows = append(
661 rows,
662 keyValue{Label: "Redactions", Value: fmt.Sprintf("%d", len(response.Result.Redactions))},
663 )
664 }
665 return renderHumanSection("Tool Invocation", rows), nil
666 },
667 toon: func() (string, error) {
668 return renderToonObject(
669 "tool_invocation",
670 []string{toolOperatorToolIDKey, automationStatusKey, "truncated", cliDurationMSKey, "bytes"},
671 []string{
672 response.ToolID.String(),
673 response.Status,
674 formatBool(response.Truncated),
675 fmt.Sprintf("%d", response.DurationMS),
676 fmt.Sprintf("%d", response.Result.Bytes),
677 },
678 ), nil
679 },
680 }
681}
682
683func toolsetListBundle(response ToolsetsResponseRecord) outputBundle {
684 return listBundle(

Callers 2

newToolInvokeCommandFunction · 0.85

Calls 6

stringOrDashFunction · 0.85
formatBoolFunction · 0.85
appendFunction · 0.85
renderHumanSectionFunction · 0.85
renderToonObjectFunction · 0.85
StringMethod · 0.45

Tested by 1