MCPcopy Index your code
hub / github.com/cli/cli / renderToolCallTitle

Function renderToolCallTitle

pkg/cmd/agent-task/shared/log.go:413–429  ·  view source on GitHub ↗

renderToolCallTitle renders a title for a tool call. Should be followed by a call to render a markdown representation of the tool call's content.

(w io.Writer, cs *iostreams.ColorScheme, toolName, title string)

Source from the content-addressed store, hash-verified

411// renderToolCallTitle renders a title for a tool call. Should be followed by a
412// call to render a markdown representation of the tool call's content.
413func renderToolCallTitle(w io.Writer, cs *iostreams.ColorScheme, toolName, title string) {
414 // Should not happen, but if it does we still want to print a heading
415 // with the information we do have.
416 if toolName == "" {
417 toolName = "Generic tool call"
418 }
419
420 if title != "" {
421 title = cs.Bold(title)
422 }
423
424 if title != "" {
425 fmt.Fprintf(w, "%s: %s\n", toolName, title)
426 } else {
427 fmt.Fprintf(w, "%s\n", toolName)
428 }
429}
430
431// genericToolCallNamesToTitles maps known generic tool call identifiers to human-friendly titles.
432var genericToolCallNamesToTitles = map[string]string{

Callers 2

renderLogEntryFunction · 0.85
renderGenericToolCallFunction · 0.85

Calls 1

BoldMethod · 0.80

Tested by

no test coverage detected