MCPcopy Index your code
hub / github.com/coder/coder / findToolByName

Function findToolByName

coderd/x/chatd/subagent_internal_test.go:704–711  ·  view source on GitHub ↗

findToolByName returns the tool with the given name from the slice, or nil if no match is found.

(tools []fantasy.AgentTool, name string)

Source from the content-addressed store, hash-verified

702// findToolByName returns the tool with the given name from the
703// slice, or nil if no match is found.
704func findToolByName(tools []fantasy.AgentTool, name string) fantasy.AgentTool {
705 for _, tool := range tools {
706 if tool.Info().Name == name {
707 return tool
708 }
709 }
710 return nil
711}
712
713func chatdTestContext(t *testing.T) context.Context {
714 t.Helper()

Calls 1

InfoMethod · 0.45

Tested by

no test coverage detected