@@ -569,9 +569,9 @@ func toolIcon(sty *styles.Styles, status ToolStatus) string {
569569 }
570570}
571571
572−// toolParamList formats parameters as "main (key=value, ...)" with truncation.
573572// toolParamList formats tool parameters as "main (key=value, ...)" with truncation.
574−func toolParamList(sty *styles.Styles, params []string, width int) string {
573+// When opts.ExpandedContent is true, the output wraps instead of truncating.
574+func toolParamList(sty *styles.Styles, params []string, width int, opts *ToolRenderOpts) string {
575575 // minSpaceForMainParam is the min space required for the main param
576576 // if this is less that the value set we will only show the main param nothing else
577577 const minSpaceForMainParam = 30
@@ -598,14 +598,18 @@ func toolParamList(sty *styles.Styles, params []string, width int) string {
598598 }
599599 }
600600
601− if width >= 0 {
601+ if width >= 0 && (opts == nil || !opts.ExpandedContent) {
602602 output = ansi.Truncate(output, width, "…")
603+ } else if opts != nil && opts.ExpandedContent && width > 0 && lipgloss.Width(output) > width {
604+ output = ansi.Hardwrap(output, width, false)
603605 }
604606 return sty.Tool.ParamMain.Render(output)
605607}
606608
607609// toolHeader builds the tool header line: "● ToolName params..."
608−func toolHeader(sty *styles.Styles, status ToolStatus, name string, width int, nested bool, params ...string) string {
610+// When opts.ExpandedContent is true, long parameters wrap instead of truncating.
611+func toolHeader(sty *styles.Styles, status ToolStatus, name string, width int, opts *ToolRenderOpts, params ...string) string {
612+ nested := opts != nil && opts.Compact
609613 icon := toolIcon(sty, status)
610614 nameStyle := sty.Tool.NameNormal
611615 if nested {
@@ -615,7 +619,18 @@ func toolHeader(sty *styles.Styles, status ToolStatus, name string, width int, n
615619 prefix := fmt.Sprintf("%s %s ", icon, toolName)
616620 prefixWidth := lipgloss.Width(prefix)
617621 remainingWidth := width - prefixWidth
618− paramsStr := toolParamList(sty, params, remainingWidth)
622+ paramsStr := toolParamList(sty, params, remainingWidth, opts)
623+
624+ // When expanded, toolParamList may return multiple lines. Indent
625+ // continuation lines to align with the first line's param text.
626+ if strings.Contains(paramsStr, "\n") {
627+ lines := strings.Split(paramsStr, "\n")
628+ indent := strings.Repeat(" ", prefixWidth)
629+ for i := 1; i < len(lines); i++ {
630+ lines[i] = indent + lines[i]
631+ }
632+ return prefix + strings.Join(lines, "\n")
633+ }
619634 return prefix + paramsStr
620635}
621636