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

Function operationDescription

pkg/tools/builtin/openapi/openapi.go:278–291  ·  view source on GitHub ↗

operationDescription returns a human-readable description for the operation.

(path, method string, op *v3.Operation)

Source from the content-addressed store, hash-verified

276
277// operationDescription returns a human-readable description for the operation.
278func operationDescription(path, method string, op *v3.Operation) string {
279 if op.Summary != "" {
280 return op.Summary
281 }
282
283 if op.Description != "" {
284 if r := []rune(op.Description); len(r) > 200 {
285 return string(r[:200]) + "..."
286 }
287 return op.Description
288 }
289
290 return fmt.Sprintf("%s %s", method, path)
291}
292
293// operationSchema builds a JSON Schema object describing the tool parameters.
294func operationSchema(op *v3.Operation) map[string]any {

Callers 1

operationToToolMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected