MCPcopy Create free account
hub / github.com/alecthomas/devtodo2 / handleList

Method handleList

mcp/server.go:185–202  ·  view source on GitHub ↗
(all bool)

Source from the content-addressed store, hash-verified

183}
184
185func (s *Server) handleList(all bool) (*mcp.CallToolResult, any, error) {
186 tasks, err := s.load()
187 if err != nil {
188 return nil, nil, fmt.Errorf("load tasks: %w", err)
189 }
190 if tasks == nil {
191 tasks = devtodo2.NewTaskList()
192 }
193
194 absPath, _ := filepath.Abs(s.file)
195 result := ListResult{
196 Title: tasks.Title(),
197 File: absPath,
198 Tasks: collectTasks(tasks, "", all),
199 }
200
201 return jsonResult(result)
202}
203
204func (s *Server) handleAdd(text, priority, parent string) (*mcp.CallToolResult, any, error) {
205 if text == "" {

Callers 1

registerToolsMethod · 0.95

Calls 5

loadMethod · 0.95
NewTaskListFunction · 0.92
collectTasksFunction · 0.85
jsonResultFunction · 0.85
TitleMethod · 0.65

Tested by

no test coverage detected