Skip to main content
Glama
MAG-Cie

MCP for Microsoft To Do

list_tasks

Read-only

Retrieve tasks from a Microsoft To Do list using filters, ordering, and pagination to manage and view task data.

Instructions

List the tasks of a To Do list. Supports OData filter, $orderby, $top, and pagination.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYes
filterNo
topNo
orderbyNo
verboseNoIf true: returns full JSON. Otherwise: compact text format (default, saves tokens).
paginateNoIf true: follows @odata.nextLink up to 20 pages (≈2000 items max). Default false. Use sparingly — large result sets may exhaust the LLM context window.

Implementation Reference

  • The CallTool handler for 'list_tasks' — parses args via Zod schema, calls the graph helper listTasks(), and formats the output (compact text or JSON depending on verbose flag).
    case "list_tasks": {
      const a = schemas.list_tasks.strict().parse(args);
      const tasks = await listTasks(a.list_id, {
        filter: a.filter,
        top: a.top,
        orderby: a.orderby,
        paginate: a.paginate,
      });
      return out(tasks, a.verbose, (ts) =>
        ts.length === 0
          ? t.noTasks
          : `${t.tasks(ts.length)}\n${ts.map(formatTaskCompact).join("\n")}`
      );
    }
  • Zod input schema for 'list_tasks' — validates list_id (required string), optional filter (OData), top, orderby, verbose, and paginate fields.
    list_tasks: z.object({
      list_id: z.string().describe("ID of the To Do list"),
      filter: z
        .string()
        .optional()
        .describe("OData filter, e.g. \"status ne 'completed'\""),
      top: z.number().int().positive().max(100).optional(),
      orderby: z
        .string()
        .optional()
        .describe("OData $orderby, e.g. 'dueDateTime/dateTime asc'"),
      ...verboseField,
      ...paginateField,
    }),
  • src/index.ts:507-523 (registration)
    MCP tool registration in the ListTools handler — advertises the 'list_tasks' tool with its name, description, and JSON Schema inputSchema.
    {
      name: "list_tasks",
      description:
        "List the tasks of a To Do list. Supports OData filter, $orderby, $top, and pagination.",
      inputSchema: {
        type: "object",
        properties: {
          list_id: { type: "string" },
          filter: { type: "string" },
          top: { type: "number" },
          orderby: { type: "string" },
          ...verboseJsonProp,
          ...paginateJsonProp,
        },
        required: ["list_id"],
      },
    },
  • The actual Graph API helper function 'listTasks' — builds OData query params and calls GET /me/todo/lists/{listId}/tasks on Microsoft Graph.
    export async function listTasks(
      listId: string,
      opts: {
        filter?: string;
        top?: number;
        orderby?: string;
        paginate?: boolean;
      } = {}
    ): Promise<TodoTask[]> {
      // Note: Microsoft Graph rejects $select on /me/todo/lists/{id}/tasks for personal
      // accounts (RequestBroker--ParseUri 400). $filter / $top / $orderby work fine.
      const qs = buildOData({
        filter: opts.filter,
        top: opts.top,
        orderby: opts.orderby,
      });
      const path = `/me/todo/lists/${enc(listId)}/tasks${qs}`;
      if (opts.paginate) return paginateAll<TodoTask>(path);
      const data = await graphFetch<GraphCollection<TodoTask>>(path);
      return data.value;
    }
  • Compact text formatter for a single task — used in the list_tasks handler to produce token-efficient output.
    export function formatTaskCompact(t: TodoTask): string {
      const parts: string[] = [t.id];
      if (t.importance === "high") parts.push("[!]");
      else if (t.importance === "low") parts.push("[?]");
      const sm = STATUS_MARKER[t.status];
      if (sm) parts.push(sm);
      parts.push(JSON.stringify(t.title));
      if (t.dueDateTime) parts.push(`due:${formatGraphDate(t.dueDateTime.dateTime)}`);
      if (t.isReminderOn && t.reminderDateTime)
        parts.push(`rem:${formatGraphDate(t.reminderDateTime.dateTime)}`);
      if (t.recurrence) parts.push(`rec:${t.recurrence.pattern.type}`);
      if (t.categories?.length) parts.push(`cat:${t.categories.join(",")}`);
      const bodyContent = t.body?.content?.trim();
      if (bodyContent) {
        const truncated =
          bodyContent.length > 100 ? bodyContent.slice(0, 100) + "…" : bodyContent;
        parts.push(`body:${JSON.stringify(truncated.replace(/\s+/g, " "))}`);
      }
      return parts.join(" ");
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint and openWorldHint. The description adds concrete behavioral details beyond annotations, such as pagination 'follows @odata.nextLink up to 20 pages (≈2000 items max)' and verbosity options, which significantly aids agent understanding.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, starting with the core purpose. It is concise but could be more structured by separating features and parameters. No unnecessary information is present.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers core behavior and pagination limits but lacks details on filter syntax, orderby format, and the structure of the return value. With no output schema, the agent must infer the response format, which is a gap given the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 33% (only verbose and paginate have descriptions). The description mentions filter, orderby, top, and pagination but does not provide syntax or format details for filter or orderby. It partially compensates for low coverage but leaves gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'List the tasks of a To Do list,' specifying the resource and verb. It mentions supported operations like OData filter, $orderby, $top, and pagination, which distinguishes it from sibling tools like list_all_tasks or list_overdue_tasks.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for listing tasks from a specific list but does not provide explicit guidance on when to use this tool versus siblings like list_overdue_tasks or search_tasks. No when-not-to-use or alternative recommendations are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MAG-Cie/mcp-microsoft-todo'

If you have feedback or need assistance with the MCP directory API, please join our Discord server