One BoundOp, three hosts

One BoundOp. HTTP, OpenAPI, and MCP are hosts.

implementroutesdoctools/callCallerHTTPBoundOpOpenAPIMCP

implement returns the BoundOp. routes is the HTTP host. The dashed doc is OpenAPI: Api.openApi reads endpoint.doc, and that document is not a second runtime. Mcp.from turns a promoted operation into a tool, and tools/call runs the same function.

Install

libraryDependencies += "rocks.earlyeffect" %% "heddle" % "0.11.0"

Endpoint.mcp

Endpoint.get is inline, so a cite expands the macro, and a call is not a definition. mcp sets doc.promoted.

heddle.endpoint.Endpoint.mcp
def mcp: Endpoint[In, Err, Out] =
    replaceDoc(doc.copy(promoted = true))

View source

get_show

The buttons replay one bound operation. They do not call a server.

same BoundOp · get_show
same BoundOp
get_showReadOnly
GET /shows/1 HTTP/1.1

HTTP/1.1 200 OK
content-type: application/json

{"id":1,"name":"Evening bill"}

HTTP, OpenAPI, MCP, and stdio are hosts. They are not copies.