Bind the effect

Api.bind is the implementation. The AST does not run itself.

Api("Box office", "0.1.0")
  .job(getShow) { id =>
    shows.get(id)
  }

The function is In => ZIO[R, E, Out]. Here In is Int, E is NotFound, Out is Show. HTTP will decode the path, run this ZIO, and encode the result. MCP will flatten arguments with OpArgs, run the same ZIO, and wrap the JSON as tool content.

The trace

Step through a GET. Decode is not your code. The bind is. Encode is not your code. Interrupting the connection interrupts the fiber.

the effect is the body · click a step

GET /shows/1 arrives. Path codec captures id = 1.

Request.get("/shows/1")

Next

The tool is the job. Compose that ZIO. Promote the bind agents should call.