Tools fetches and parses the OpenAPI specification, returning a tool for each operation.
(ctx context.Context)
| 105 | |
| 106 | // Tools fetches and parses the OpenAPI specification, returning a tool for each operation. |
| 107 | func (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. |
| 117 | func (t *ToolSet) fetchSpec(ctx context.Context) (*v3.Document, error) { |
nothing calls this directly
no test coverage detected