def call.args
import ezmcp@0.1.0.0/src/server.bend as Serverimport Base
import emerging-ezjson@1.2.0.0/main.bend as Json
import emerging-ezjson@1.2.0.0/src/value.bend as Value
198# the arguments of a call: absent is no arguments, an object is passed on,
199# anything else is invalid
200def call.args(+name: String, has: Bool, +args: Value.Json) -> Step:
201 match has:
202 case False{}:
203 Call{name, Json.obj([])}
204 case True{}:
205 Bool.pick(Step, Json.is_obj(args), Call{name, args},
206 invalid("tools/call: arguments must be an object"))