outlook-mcp
Version:
Comprehensive MCP server for Claude to access Microsoft Outlook and Teams via Microsoft Graph API - including Email, Calendar, Contacts, Tasks, Teams, Chats, and Online Meetings
213 lines (211 loc) • 5.72 kB
JavaScript
/**
* Tasks module for Outlook MCP server
*/
const handleListTasks = require('./list');
const handleCreateTask = require('./create');
const handleUpdateTask = require('./update');
const handleDeleteTask = require('./delete');
const { handleListTaskLists, handleCreateTaskList, handleDeleteTaskList } = require('./lists');
// Tasks tool definitions
const tasksTools = [
{
name: "list-tasks",
description: "Lists tasks from your Microsoft To-Do",
inputSchema: {
type: "object",
properties: {
listId: {
type: "string",
description: "Task list ID to retrieve tasks from (uses default list if not specified)"
},
status: {
type: "string",
enum: ["all", "notStarted", "inProgress", "completed"],
description: "Filter tasks by status (default: 'all')"
},
count: {
type: "number",
description: "Number of tasks to retrieve (default: 25, max: 50)"
},
orderBy: {
type: "string",
description: "Order tasks by field (default: 'createdDateTime desc')"
}
},
required: []
},
handler: handleListTasks
},
{
name: "create-task",
description: "Creates a new task in Microsoft To-Do",
inputSchema: {
type: "object",
properties: {
title: {
type: "string",
description: "Title of the task"
},
body: {
type: "string",
description: "Task description/notes"
},
dueDateTime: {
type: "string",
description: "Due date and time in ISO format (e.g., '2024-01-15T10:00:00')"
},
reminderDateTime: {
type: "string",
description: "Reminder date and time in ISO format"
},
importance: {
type: "string",
enum: ["low", "normal", "high"],
description: "Task importance level (default: 'normal')"
},
isReminderOn: {
type: "boolean",
description: "Whether reminder is enabled (default: false)"
},
categories: {
type: "array",
items: {
type: "string"
},
description: "List of categories for the task"
},
listId: {
type: "string",
description: "Task list ID to create task in (uses default list if not specified)"
}
},
required: ["title"]
},
handler: handleCreateTask
},
{
name: "update-task",
description: "Updates an existing task in Microsoft To-Do",
inputSchema: {
type: "object",
properties: {
taskId: {
type: "string",
description: "ID of the task to update"
},
listId: {
type: "string",
description: "Task list ID containing the task (uses default list if not specified)"
},
title: {
type: "string",
description: "New title for the task"
},
body: {
type: "string",
description: "New task description/notes"
},
status: {
type: "string",
enum: ["notStarted", "inProgress", "completed"],
description: "New task status"
},
dueDateTime: {
type: "string",
description: "New due date and time in ISO format (use null or empty string to remove)"
},
reminderDateTime: {
type: "string",
description: "New reminder date and time in ISO format (use null or empty string to remove)"
},
importance: {
type: "string",
enum: ["low", "normal", "high"],
description: "New task importance level"
},
isReminderOn: {
type: "boolean",
description: "Whether reminder is enabled"
},
categories: {
type: "array",
items: {
type: "string"
},
description: "New list of categories for the task"
}
},
required: ["taskId"]
},
handler: handleUpdateTask
},
{
name: "delete-task",
description: "Deletes a task from Microsoft To-Do",
inputSchema: {
type: "object",
properties: {
taskId: {
type: "string",
description: "ID of the task to delete"
},
listId: {
type: "string",
description: "Task list ID containing the task (uses default list if not specified)"
}
},
required: ["taskId"]
},
handler: handleDeleteTask
},
{
name: "list-task-lists",
description: "Lists all task lists in Microsoft To-Do",
inputSchema: {
type: "object",
properties: {},
required: []
},
handler: handleListTaskLists
},
{
name: "create-task-list",
description: "Creates a new task list in Microsoft To-Do",
inputSchema: {
type: "object",
properties: {
displayName: {
type: "string",
description: "Name of the new task list"
}
},
required: ["displayName"]
},
handler: handleCreateTaskList
},
{
name: "delete-task-list",
description: "Deletes a task list from Microsoft To-Do",
inputSchema: {
type: "object",
properties: {
listId: {
type: "string",
description: "ID of the task list to delete"
}
},
required: ["listId"]
},
handler: handleDeleteTaskList
}
];
module.exports = {
tasksTools,
handleListTasks,
handleCreateTask,
handleUpdateTask,
handleDeleteTask,
handleListTaskLists,
handleCreateTaskList,
handleDeleteTaskList
};