/**
* Task management tool definitions.
* @module
*/
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
export const taskTools: Tool[] = [
{
name: "get_tasks",
description: "Get all TODO and DOING tasks from Logseq. Can filter by page name.",
inputSchema: {
type: "object",
properties: {
pageName: {
type: "string",
description: "Optional: filter tasks to a specific page",
},
markers: {
type: "array",
items: {
type: "string",
enum: ["TODO", "DOING", "DONE", "CANCELED"],
},
description: 'Optional: filter by task markers (default: ["TODO", "DOING"])',
},
},
},
},
{
name: "create_task",
description: "Create a new TODO task in Logseq on a specified page",
inputSchema: {
type: "object",
properties: {
pageName: {
type: "string",
description: "Name of the page to create the task on",
},
content: {
type: "string",
description: "Task description (without TODO prefix)",
},
priority: {
type: "string",
enum: ["A", "B", "C"],
description: "Optional: task priority (A=high, B=medium, C=low)",
},
deadline: {
type: "string",
description: "Optional: deadline date in ISO format (YYYY-MM-DD)",
},
scheduled: {
type: "string",
description: "Optional: scheduled date in ISO format (YYYY-MM-DD)",
},
},
required: ["pageName", "content"],
},
},
{
name: "mark_task",
description: "Change a task's status (TODO, DOING, DONE, or CANCELED)",
inputSchema: {
type: "object",
properties: {
uuid: {
type: "string",
description: "UUID of the task block",
},
marker: {
type: "string",
enum: ["TODO", "DOING", "DONE", "CANCELED"],
description: "New status for the task",
},
},
required: ["uuid", "marker"],
},
},
{
name: "mark_tasks",
description:
"Change multiple tasks' status in a single operation. " +
"More efficient than calling mark_task multiple times. " +
"Returns a summary of successful and failed operations.",
inputSchema: {
type: "object",
properties: {
uuids: {
type: "array",
items: { type: "string" },
description: "Array of task block UUIDs to update",
},
marker: {
type: "string",
enum: ["TODO", "DOING", "DONE", "CANCELED"],
description: "New status for all tasks",
},
},
required: ["uuids", "marker"],
},
},
{
name: "set_task_priority",
description: "Set or remove a task's priority level",
inputSchema: {
type: "object",
properties: {
uuid: {
type: "string",
description: "UUID of the task block",
},
priority: {
type: ["string", "null"],
enum: ["A", "B", "C", null],
description: "Priority level (A=high, B=medium, C=low) or null to remove",
},
},
required: ["uuid", "priority"],
},
},
{
name: "set_task_deadline",
description: "Set or remove a task's deadline date",
inputSchema: {
type: "object",
properties: {
uuid: {
type: "string",
description: "UUID of the task block",
},
date: {
type: ["string", "null"],
description: "Deadline date in ISO format (YYYY-MM-DD) or null to remove",
},
},
required: ["uuid", "date"],
},
},
{
name: "set_task_scheduled",
description: "Set or remove a task's scheduled date",
inputSchema: {
type: "object",
properties: {
uuid: {
type: "string",
description: "UUID of the task block",
},
date: {
type: ["string", "null"],
description: "Scheduled date in ISO format (YYYY-MM-DD) or null to remove",
},
},
required: ["uuid", "date"],
},
},
{
name: "search_tasks",
description: "Search for tasks by keyword. Returns tasks containing the search term.",
inputSchema: {
type: "object",
properties: {
query: {
type: "string",
description: "Search query to find in task content",
},
markers: {
type: "array",
items: {
type: "string",
enum: ["TODO", "DOING", "DONE", "CANCELED"],
},
description: "Optional: filter by task markers (default: all)",
},
pageName: {
type: "string",
description: "Optional: filter to a specific page",
},
},
required: ["query"],
},
},
{
name: "get_overdue_tasks",
description: "Get tasks with deadlines in the past",
inputSchema: {
type: "object",
properties: {},
},
},
{
name: "get_tasks_due_soon",
description: "Get tasks due within a specified number of days",
inputSchema: {
type: "object",
properties: {
days: {
type: "number",
description: "Number of days to look ahead (default: 7)",
},
markers: {
type: "array",
items: {
type: "string",
enum: ["TODO", "DOING", "DONE", "CANCELED"],
},
description: "Optional: filter by task markers (default: TODO, DOING)",
},
},
},
},
{
name: "get_task_stats",
description: "Get aggregated task statistics (counts by status, priority, overdue)",
inputSchema: {
type: "object",
properties: {
pageName: {
type: "string",
description: "Optional: filter stats to a specific page",
},
},
},
},
];