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

Method Tools

pkg/tools/builtin/openapi/openapi.go:107–114  ·  view source on GitHub ↗

Tools fetches and parses the OpenAPI specification, returning a tool for each operation.

(ctx context.Context)

Source from the content-addressed store, hash-verified

105
106// Tools fetches and parses the OpenAPI specification, returning a tool for each operation.
107func (t *ToolSet) Tools(ctx context.Context) ([]tools.Tool, error) {
108 spec, err := t.fetchSpec(ctx)
109 if err != nil {
110 return nil, fmt.Errorf("failed to fetch OpenAPI spec from %s: %w", t.specURL, err)
111 }
112
113 return t.buildTools(spec)
114}
115
116// fetchSpec retrieves and parses the OpenAPI specification from the configured URL.
117func (t *ToolSet) fetchSpec(ctx context.Context) (*v3.Document, error) {

Callers

nothing calls this directly

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 2

fetchSpecMethod · 0.95
buildToolsMethod · 0.95

Tested by

no test coverage detected