OutputSchema
object OutputSchema
Builds the JSON Schema a tool advertises as McpTool.outputSchema, and checks result maps against it.
override val outputSchema = OutputSchema.obj {
integer("count")
array("events") {
integer("id")
string("title", nullable = true)
string("end", nullable = true)
}
}Content copied to clipboard
Every field is listed in required unless declared optional = true (for keys a tool only sometimes returns). nullable = true allows the key to hold JSON null. Objects stay open (no additionalProperties: false), so adding a result key later is not a breaking change.
Types
Link copied to clipboard
class ObjectBuilder
Declares the properties of one object schema.
Functions
Link copied to clipboard
An object schema built by block. Use as the top-level McpTool.outputSchema.
Link copied to clipboard