MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / parseFSGetArgs

Function parseFSGetArgs

server/mcp/fs_get.go:101–114  ·  view source on GitHub ↗
(raw json.RawMessage)

Source from the content-addressed store, hash-verified

99}
100
101func parseFSGetArgs(raw json.RawMessage) (*fsGetArgs, *rpcError) {
102 args := &fsGetArgs{}
103 if len(raw) == 0 || string(raw) == "null" {
104 return nil, &rpcError{Code: -32602, Message: "invalid openlist.fs.get arguments"}
105 }
106
107 if err := json.Unmarshal(raw, args); err != nil {
108 return nil, &rpcError{Code: -32602, Message: "invalid openlist.fs.get arguments"}
109 }
110 if args.Path == "" {
111 return nil, &rpcError{Code: -32602, Message: "path is required"}
112 }
113 return args, nil
114}
115
116func buildFSGetRawURL(ctx context.Context, c *gin.Context, reqPath string, obj model.Obj, meta *model.Meta) (string, string, error) {
117 storage, storageErr := fs.GetStorage(reqPath, &fs.GetStoragesArgs{})

Callers 4

TestParseFSGetArgsFunction · 0.85
callFSGetMethod · 0.85

Calls 1

UnmarshalMethod · 0.45

Tested by 3

TestParseFSGetArgsFunction · 0.68