MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / optionalMCPSchema

Function optionalMCPSchema

tools/mcp_schema.go:123–132  ·  view source on GitHub ↗
(schema map[string]any)

Source from the content-addressed store, hash-verified

121}
122
123func optionalMCPSchema(schema map[string]any) map[string]any {
124 if _, ok := schema["anyOf"]; ok {
125 out := copySchemaMap(schema)
126 out["default"] = nil
127 return out
128 }
129 out := nullableMCPSchema(schema)
130 out["default"] = nil
131 return out
132}
133
134func nullableMCPSchema(schema map[string]any) map[string]any {
135 inner := copySchemaMap(schema)

Callers 1

buildMCPObjectSchemaFunction · 0.85

Calls 2

copySchemaMapFunction · 0.85
nullableMCPSchemaFunction · 0.85

Tested by

no test coverage detected