MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / refAsItemRef

Function refAsItemRef

internal/mcp/dispatch_http_github.go:96–108  ·  view source on GitHub ↗

refAsItemRef dispatches cmdPath with the catalog's `ref` under `item_ref`, the name `pad github link [item-ref]` / `unlink ` give their positional (TASK-3611): every other pad_item action takes `ref`, so the catalog keeps that name and translates here, for both transports.

(cmdPath []string)

Source from the content-addressed store, hash-verified

94// positional (TASK-3611): every other pad_item action takes `ref`, so the
95// catalog keeps that name and translates here, for both transports.
96func refAsItemRef(cmdPath []string) ActionFn {
97 return func(ctx context.Context, input map[string]any, env ActionEnv) (*CallToolResult, error) {
98 out := make(map[string]any, len(input))
99 for k, v := range input {
100 out[k] = v
101 }
102 if v, ok := out["ref"]; ok {
103 out["item_ref"] = v
104 delete(out, "ref")
105 }
106 return env.Dispatch(ctx, cmdPath, out)
107 }
108}

Callers 1

catalog_item.goFile · 0.85

Calls 3

deleteFunction · 0.85
DispatchMethod · 0.65
makeFunction · 0.50

Tested by

no test coverage detected