fn(arguments$0, request$1) =>
#read_perf_records<@definy.service-io>({
authorization: match @http.field-get(fields: $1.headers, name: "authorization") {
#some(value$2) =>
$2,
#none(_) =>
""
},
limit: match @definy.json-get-number(value: $0, key: "limit") {
#some(limit$3) =>
$3,
#none(_) =>
20
},
path_contains: match @definy.json-get(value: $0, key: "allRequests") {
#some(value$4) =>
match $4 {
#boolean(all$5) =>
match $5 {
true =>
"",
false =>
"SubmitEvent"
},
_ =>
"SubmitEvent"
},
#none(_) =>
"SubmitEvent"
},
then: fn(result$6) =>
match @core.equal(left: $6.status, right: 200) {
true =>
@definy.mcp-text(text: $6.body),
false =>
@definy.mcp-text-error(text: $6.body)
}
})