mcp.api.schema

Undocumented in source.

Members

Functions

jsonSchemaOf
Json jsonSchemaOf()

Generate a JSON Schema (2020-12) fragment describing the D type T.

validateAgainstSchema
string validateAgainstSchema(Json value, Json schema)

Validate a JSON value against a JSON Schema schema (a schema document of the kind produced by jsonSchemaOf).

Templates

isElicitScalar
template isElicitScalar(F)

A field type permitted in an elicitation form schema: a scalar (string / number / integer / boolean / enum), optionally wrapped in Nullable. The elicitation requestedSchema (SEP-1034/1330) is a flat object of such primitives — no nested objects or arrays.

isFlatElicitationStruct
template isFlatElicitationStruct(T)

True when T is a flat struct whose every field is an isElicitScalar, i.e. a valid type to derive an elicitation form requestedSchema from (via jsonSchemaOf!T). Used by RequestContext.elicit!T and InputRequest.elicitation!T to reject nested/array structs at compile time.