MCPcopy Index your code
hub / github.com/modelcontextprotocol/registry / loadSchemaByVersion

Function loadSchemaByVersion

internal/validators/schema.go:37–44  ·  view source on GitHub ↗

loadSchemaByVersion loads a schema file from the embedded filesystem by version

(version string)

Source from the content-addressed store, hash-verified

35
36// loadSchemaByVersion loads a schema file from the embedded filesystem by version
37func loadSchemaByVersion(version string) ([]byte, error) {
38 filename := fmt.Sprintf("schemas/%s.json", version)
39 data, err := schemaFS.ReadFile(filename)
40 if err != nil {
41 return nil, fmt.Errorf("schema version %s not found in embedded schemas: %w", version, err)
42 }
43 return data, nil
44}
45
46// GetCurrentSchemaVersion returns the current schema URL from constants
47func GetCurrentSchemaVersion() (string, error) {

Callers 1

validateServerJSONSchemaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…