Skip to content

Feature Overview: Context Window Optimization for Batch Task Management

Every MCP tool call returns JSON that fills your context window. Traditional task management tools force a loop-per-task pattern that scales linearly with task count:

OperationLoop Approachdart-query
Update 50 task statuses50 calls, ~30,000 tokens1 call, ~200 tokens
Delete 20 completed tasks20 calls, ~10,000 tokens1 call, ~150 tokens
Create 100 tasks from CSV100 calls, ~50,000 tokens1 call, ~500 tokens

After a 50-task loop, the agent has consumed so much context that subsequent reasoning degrades. dart-query eliminates this entirely with server-side batch execution.

// 50 API calls, ~30K tokens of intermediate JSON
for (const task of tasks) {
update_task({ dart_id: task.id, status: "Done" })
// Each response: ~600 tokens of JSON
// Agent must parse, discard, repeat
}
// 1 API call, ~200 tokens total
execute_dartql({
query: "UPDATE WHERE dartboard = 'Sprint 12' AND status = 'Todo' SET status = 'Done'",
dry_run: false
})
// Response: { total_matched: 50, total_succeeded: 50 }

DartQL uses SQL-92 WHERE clause syntax that any developer already knows. No proprietary query language to learn.

-- Target by dartboard and priority
UPDATE WHERE dartboard = 'Engineering' AND priority = 4
SET status = 'Doing'
-- Pattern matching with LIKE
UPDATE WHERE title LIKE '%auth%' SET tags = ['security', 'auth']
-- Range queries
DELETE WHERE due_at < '2025-01-01' AND status = 'Done' CONFIRM
-- Set operations
UPDATE WHERE tags CONTAINS 'bug' AND priority IN (4, 5)
SET assignee = 'oncall@company.com'

Supported operators: =, !=, <>, >, >=, <, <=, LIKE, IN, NOT IN, BETWEEN, IS NULL, IS NOT NULL, CONTAINS

Multi-statement execution lets you chain operations in a single call:

execute_dartql({
query: `
UPDATE WHERE dartboard = 'Sprint 11' AND status != 'Done' SET dartboard = 'Sprint 12';
UPDATE WHERE dartboard = 'Sprint 12' AND priority = 5 SET status = 'Doing'
`,
dry_run: true // preview both operations first
})

Production task data demands careful defaults. dart-query builds safety into every destructive operation:

Dry-Run by Default

All batch operations default to dry_run: true. You always preview before executing. No accidental bulk updates.

Delete Confirmation

Batch deletes require an explicit CONFIRM keyword when dry_run: false. Two-step protection against accidental deletion.

Recoverable Trash

Deleted tasks move to trash and stay recoverable from the Dart AI interface.

Validation Phase

CSV imports validate every row before creating anything. Catch typos, invalid assignees, and bad dates before they become tasks.

// Step 1: Preview what will change
execute_dartql({
query: "UPDATE WHERE status = 'Blocked' SET priority = 5",
dry_run: true
})
// Response shows matched tasks without modifying anything
// Step 2: Execute after reviewing
execute_dartql({
query: "UPDATE WHERE status = 'Blocked' SET priority = 5",
dry_run: false
})

dart-query’s info tool uses three detail levels with strict token budgets, so agents load only the documentation they need:

LevelWhat You GetToken Cost
overviewAll 7 tool groups in a sparse table~150 tokens
groupTools in one group with descriptions~200 tokens
toolFull schema, examples, and DartQL syntax~500 tokens
// Start broad
info()
// "7 tool groups: discovery, config, task-crud, task-query, task-batch, import, doc-crud"
// Drill into what you need
info({ level: "group", target: "task-batch" })
// "3 tools: execute_dartql, batch_update_tasks, batch_delete_tasks"
// Get full docs for one tool
info({ level: "tool", target: "execute_dartql" })
// Complete parameter schema, examples, DartQL reference

No wasted tokens loading documentation for tools you are not using.

Every dart-query response is designed to stay compact:

OperationTypical Response Size
info() overview~150 tokens
get_config()~400 tokens
Single task CRUD~200-300 tokens
Batch operation summary~400 tokens
CSV import result~500 tokens

Batch operations return aggregate summaries (matched count, success count, failure count) rather than echoing back every modified task. This is the core of context window optimization: the server does the work, you get the result.