MCPcopy Create free account
hub / github.com/docker/docker-agent / Tools

Method Tools

pkg/tools/builtin/rag/rag.go:147–168  ·  view source on GitHub ↗
(context.Context)

Source from the content-addressed store, hash-verified

145}
146
147func (t *ToolSet) Tools(context.Context) ([]tools.Tool, error) {
148 var description string
149 if t.manager != nil {
150 description = t.manager.Description()
151 }
152 description = cmp.Or(description, fmt.Sprintf("Search project documents from %s to find relevant code or documentation. "+
153 "Provide a natural language query describing what you need. "+
154 "Returns the most relevant document chunks with file paths.", t.toolName))
155
156 return []tools.Tool{{
157 Name: t.toolName,
158 Category: "knowledge",
159 Description: description,
160 Parameters: tools.MustSchemaFor[queryRAGArgs](),
161 OutputSchema: tools.MustSchemaFor[[]queryResult](),
162 Handler: tools.NewHandler(t.handleQueryRAG),
163 Annotations: tools.ToolAnnotations{
164 ReadOnlyHint: true,
165 Title: "Query " + t.toolName,
166 },
167 }}, nil
168}
169
170func (t *ToolSet) handleQueryRAG(ctx context.Context, args queryRAGArgs) (*tools.ToolCallResult, error) {
171 if args.Query == "" {

Callers 2

TestRAGTool_ToolNameFunction · 0.95

Implementers 15

StartableToolSetpkg/tools/startable.go
fakeToolSetpkg/tools/named_test.go
stubDescriberpkg/tools/startable_test.go
stubToolSetpkg/tools/startable_test.go
flappyToolSetpkg/tools/startable_test.go
listFlappyToolSetpkg/tools/startable_test.go
reportingToolSetpkg/tools/startable_test.go
reportingStartOnlyToolSetpkg/tools/startable_test.go
recoveryFailingToolSetpkg/tools/startable_test.go
codeModeToolpkg/tools/codemode/codemode.go
testToolSetpkg/tools/codemode/codemode_test.go
Toolsetpkg/tools/a2a/a2a.go

Calls 3

MustSchemaForFunction · 0.92
NewHandlerFunction · 0.92
DescriptionMethod · 0.45

Tested by 2

TestRAGTool_ToolNameFunction · 0.76