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

Function parseFSListArgs

server/mcp/fs_list.go:83–100  ·  view source on GitHub ↗
(raw json.RawMessage)

Source from the content-addressed store, hash-verified

81}
82
83func parseFSListArgs(raw json.RawMessage) (*fsListArgs, *rpcError) {
84 args := &fsListArgs{
85 Page: 1,
86 PerPage: model.MaxInt,
87 }
88 if len(raw) == 0 || string(raw) == "null" {
89 return nil, &rpcError{Code: -32602, Message: "invalid openlist.fs.list arguments"}
90 }
91
92 if err := json.Unmarshal(raw, args); err != nil {
93 return nil, &rpcError{Code: -32602, Message: "invalid openlist.fs.list arguments"}
94 }
95 if args.Path == "" {
96 return nil, &rpcError{Code: -32602, Message: "path is required"}
97 }
98 normalizeFSListArgs(args)
99 return args, nil
100}
101
102func normalizeFSListArgs(args *fsListArgs) {
103 pageReq := model.PageReq{

Callers 4

TestParseFSListArgsFunction · 0.85
assertFSListPathRequiredFunction · 0.85
callFSListMethod · 0.85

Calls 2

normalizeFSListArgsFunction · 0.85
UnmarshalMethod · 0.45

Tested by 3

TestParseFSListArgsFunction · 0.68
assertFSListPathRequiredFunction · 0.68