MCPcopy Index your code
hub / github.com/coder/coder / marshalToolResponse

Function marshalToolResponse

coderd/x/chatd/chattool/chattool.go:17–23  ·  view source on GitHub ↗
(result any)

Source from the content-addressed store, hash-verified

15)
16
17func marshalToolResponse(result any) fantasy.ToolResponse {
18 data, err := json.Marshal(result)
19 if err != nil {
20 return fantasy.NewTextResponse("{}")
21 }
22 return fantasy.NewTextResponse(string(data))
23}
24
25// toolResponse builds a fantasy.ToolResponse from a JSON-serializable
26// result map. The map constraint ensures all tool results serialize

Callers 3

toolResponseFunction · 0.85
buildToolResponseFunction · 0.85
quotaErrorToolResponseFunction · 0.85

Calls 1

MarshalMethod · 0.45

Tested by

no test coverage detected