MCPcopy Create free account
hub / github.com/github/gh-aw / toolWithMaxBudget

Function toolWithMaxBudget

pkg/workflow/unified_prompt_step.go:513–518  ·  view source on GitHub ↗

toolWithMaxBudget formats a tool name with a per-call budget annotation when the configured maximum is greater than 1. This helps agents understand that multiple calls to the same tool are allowed for the current workflow. Returns "toolname" when max is nil or "1" (default single-call behavior). Re

(name string, max *string)

Source from the content-addressed store, hash-verified

511// Returns "toolname" when max is nil or "1" (default single-call behavior).
512// Returns "toolname(max:N)" when max > 1 so agents know the real action budget.
513func toolWithMaxBudget(name string, max *string) string {
514 if max == nil || *max == "1" {
515 return name
516 }
517 return fmt.Sprintf("%s(max:%s)", name, *max)
518}
519
520// buildSafeOutputsSections returns the PromptSections that form the <safe-output-tools> block.
521// The block contains:

Callers 2

TestToolWithMaxBudgetFunction · 0.85
buildSafeOutputsSectionsFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestToolWithMaxBudgetFunction · 0.68