MCPcopy
hub / github.com/docker/docker-agent / ResultJSON

Function ResultJSON

pkg/tools/tools.go:164–170  ·  view source on GitHub ↗

ResultJSON marshals v as JSON and returns it as a successful tool result. If marshaling fails, it returns an error result.

(v any)

Source from the content-addressed store, hash-verified

162// ResultJSON marshals v as JSON and returns it as a successful tool result.
163// If marshaling fails, it returns an error result.
164func ResultJSON(v any) *ToolCallResult {
165 data, err := json.Marshal(v)
166 if err != nil {
167 return ResultError(err.Error())
168 }
169 return &ToolCallResult{Output: string(data)}
170}
171
172type ToolType string
173

Callers 15

CallToolMethod · 0.92
writePlanMethod · 0.92
updatePlanFromFileMethod · 0.92
exportPlanToFileMethod · 0.92
setPlanStatusMethod · 0.92
getPlanStatusMethod · 0.92
readPlanMethod · 0.92
listPlansMethod · 0.92
deletePlanMethod · 0.92
deleteTaskMethod · 0.92
listTasksMethod · 0.92
nextTaskMethod · 0.92

Calls 2

ResultErrorFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected