MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / NewTaskListTool

Function NewTaskListTool

agent/agent_tool.go:308–322  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

306}
307
308func NewTaskListTool() coretools.Tool {
309 return newTaskTool("TaskList", "List all direct child tasks spawned by the current agent scope, including their status, usage, and result metadata.", TaskListInput{}, func(_ context.Context, execCtx coretools.ExecutionContext, _ any) (string, error) {
310 rt, scope, err := runtimeAndScope(execCtx)
311 if err != "" {
312 return err, nil
313 }
314 records := rt.ListTasks(scope)
315 tasks := make([]map[string]any, 0, len(records))
316 for _, record := range records {
317 tasks = append(tasks, serializeTaskPayload(record.ToMap()))
318 }
319 payload := map[string]any{"tasks": tasks}
320 return jsonString(payload), nil
321 })
322}
323
324func NewTaskGetTool() coretools.Tool {
325 return newTaskTool("TaskGet", "Get the latest details for one direct child task by task_id, including status, result text, error text, usage, and lifecycle metadata.", TaskGetInput{}, func(_ context.Context, execCtx coretools.ExecutionContext, input any) (string, error) {

Calls 6

newTaskToolFunction · 0.85
runtimeAndScopeFunction · 0.85
serializeTaskPayloadFunction · 0.85
jsonStringFunction · 0.85
ListTasksMethod · 0.80
ToMapMethod · 0.45