MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / Definitions

Method Definitions

internal/tool/registry.go:53–64  ·  view source on GitHub ↗

Definitions returns all registered tool schemas, sorted by name so the output is deterministic (important for prompt caching when you turn it on).

()

Source from the content-addressed store, hash-verified

51// Definitions returns all registered tool schemas, sorted by name so the
52// output is deterministic (important for prompt caching when you turn it on).
53func (r *Registry) Definitions() []api.ToolDef {
54 names := make([]string, 0, len(r.tools))
55 for n := range r.tools {
56 names = append(names, n)
57 }
58 sort.Strings(names)
59 out := make([]api.ToolDef, 0, len(r.tools))
60 for _, n := range names {
61 out = append(out, r.tools[n].Definition())
62 }
63 return out
64}
65
66// Execute dispatches a tool call by name. Unknown tools return an error
67// result rather than panicking — the model can read it and recover.

Callers 4

cmdToolsFunction · 0.80
loopMethod · 0.80
TestSubsetEmptyFunction · 0.80

Calls 1

DefinitionMethod · 0.65

Tested by 2

TestSubsetEmptyFunction · 0.64