Explorer

definy.mcp-perf-recent-submits

description
The definy_perf_recent_submits MCP tool (read_perf_records with the Authorization header of the MCP request)
type
Fn(arguments: @definy.json, request: @http.request) -> @definy.service-io
expression
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)
      }
  })
visibility
public
definy.mcp-perf-recent-submits (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: kh6QsocSCvUDGBNt7RltFfzQKtTqCqjNKuwbh4eyLN8
content hash: srOhRklzsrOnAVRN7b8mS1ibZHfnntU2-qVZUuJsmoM