operationDescription returns a human-readable description for the operation.
(path, method string, op *v3.Operation)
| 276 | |
| 277 | // operationDescription returns a human-readable description for the operation. |
| 278 | func 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. |
| 294 | func operationSchema(op *v3.Operation) map[string]any { |