Class: Rubino::Tools::TodoTool

Inherits:
Base
  • Object
show all
Defined in:
lib/rubino/tools/todo_tool.rb

Overview

Tool for managing a task/todo list during a session. Allows the agent to track progress on complex multi-step tasks.

Instance Attribute Summary

Attributes inherited from Base

#cancel_token, #read_tracker, #stream_chunk

Instance Method Summary collapse

Methods inherited from Base

#cancellation_requested?, #config_key, #emit_chunk, #risky?, #to_tool_definition, workspace_root, workspace_roots

Instance Method Details

#call(arguments) ⇒ Object



52
53
54
55
56
57
# File 'lib/rubino/tools/todo_tool.rb', line 52

def call(arguments)
  todos = arguments["todos"] || arguments[:todos]
  return "Error: No todos provided" unless todos.is_a?(Array)

  format_todo_summary(todos)
end

#descriptionObject



12
13
14
15
16
# File 'lib/rubino/tools/todo_tool.rb', line 12

def description
  "Create and manage a structured task list for the current session. " \
    "Use this to track progress on complex multi-step tasks. " \
    "Tasks have content, status (pending/in_progress/completed/cancelled), and priority."
end

#input_schemaObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/rubino/tools/todo_tool.rb', line 18

def input_schema
  {
    type: "object",
    properties: {
      todos: {
        type: "array",
        items: {
          type: "object",
          properties: {
            content: { type: "string", description: "Brief description of the task" },
            status: {
              type: "string",
              enum: %w[pending in_progress completed cancelled],
              description: "Current task status"
            },
            priority: {
              type: "string",
              enum: %w[high medium low],
              description: "Task priority level"
            }
          },
          required: %w[content status priority]
        },
        description: "The complete updated todo list"
      }
    },
    required: %w[todos]
  }
end

#nameObject



8
9
10
# File 'lib/rubino/tools/todo_tool.rb', line 8

def name
  "todowrite"
end

#risk_levelObject



48
49
50
# File 'lib/rubino/tools/todo_tool.rb', line 48

def risk_level
  :low
end