def ran

ezmcp@0.1.0.0 · src/server.bend:442

import ezmcp@0.1.0.0/src/server.bend as Server
import Base
import emerging-ezjson@1.2.0.0/src/value.bend as Value
import ezmcp@0.1.0.0/src/rpc.bend as Rpc

442# the reply to a tool call under revision `rev`, once the runner answered:
443# its tool result, shaped for the revision, or the protocol error it chose
444# (server/tools#error-handling)
445def ran(rev: String, id: Value.Json, out: Rpc.Out) -> Value.Json:
446  match out:
447    case Rpc.Ok{result}:
448      Rpc.reply(id, Rpc.Ok{shape(rev, result)})
449    case Rpc.Err{c, message}:
450      Rpc.reply(id, Rpc.Err{c, message})

Uses (5)

Used by (4)