Skip to main content
Glama
routineco

Routine

Official
by routineco

taskUpdate

Update task details such as status, notes, and scheduling using the taskUpdate tool to maintain accurate and organized task management.

Instructions

Patch a task.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
confirmYes
idYes
patchYes

Implementation Reference

  • Handler function for the 'taskUpdate' tool. It calls sendRpcRequest with 'task.update' RPC method, passing the id, patch, and confirm parameters, formats the response as text content, and handles errors.
    async ({ id, patch, confirm }) => {
      try {
        const data = await sendRpcRequest("task.update", [id, patch, confirm]);
        return {
          content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
        };
      } catch (error) {
        logger.error("Error fetching task.update: %o", error);
        return {
          content: [
            {
              type: "text",
              text: `Error fetching auth id: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Input schema using Zod for 'taskUpdate' tool: id (string), patch (detailed object for patching task properties including scheduling, notes, parent, etc.), confirm (optional string). Includes embedded JSON schemas in comments.
        {
          /*
    {"$id":"#task-id","$schema":"https://json-schema.org/draft/2019-09/schema","type":"string"}
    */ id: z.string(),
    
          /*
    {"additionalProperties":false,"properties":{"ignored":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Ignored","default":null,"type":["null","string"]},"completed":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Completed","default":null,"type":["null","string"]},"integration_id":{"$id":"#integration-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Integration_id","type":"string"},"distant_task_id":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Distant_task_id","type":"string"},"integration_data":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Integration_data","default":null,"type":"null"},"occurrence":{"additionalProperties":false,"properties":{"date":{"items":[{"$schema":"https://json-schema.org/draft/2019-09/schema","type":"integer"},{"$schema":"https://json-schema.org/draft/2019-09/schema","type":"integer"},{"$schema":"https://json-schema.org/draft/2019-09/schema","type":"integer"}],"$id":"#date","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Date","type":"array"},"recurrence":{"$id":"#task-rec-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Recurrence","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Occurrence","default":null,"type":["null","object"]},"parent":{"additionalProperties":false,"properties":{"kind":{"anyOf":[{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"event","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"event-rec","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"page","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"people","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"task","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"task-rec","type":"string"}],"$id":"#kind","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Kind","type":"string"},"id":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Parent","default":null,"type":["null","object"]},"scheduled":{"anyOf":[{"type":"null"},{"type":"null"},{"additionalProperties":false,"properties":{"year":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Year","type":"integer"},"n":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"N","type":"integer"}},"$id":"#week","$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},{"$schema":"https://json-schema.org/draft/2019-09/schema","$ref":"#date"}],"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Scheduled","default":null,"type":["null","object"]},"starred":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Starred","default":null,"type":["boolean","null"]},"notes":{"additionalProperties":false,"properties":{"blocks":{"items":{"anyOf":[{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"blockquote","type":"string"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"bullet","type":"string"},"list_type":{"anyOf":[{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"ordered","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"unordered","type":"string"}],"$id":"#block-list-type","$schema":"https://json-schema.org/draft/2019-09/schema","title":"List_type","type":"string"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"},"depth":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Depth","default":0,"type":"integer"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"check","type":"string"},"checked":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Checked","type":"boolean"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"code","type":"string"},"language":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Language","type":"string"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"callout","type":"string"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"divider","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"embed","type":"string"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"heading","type":"string"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"},"level":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Level","type":"integer"},"retracted":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Retracted","default":false,"type":"boolean"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"paragraph","type":"string"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"query","type":"string"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"recurrent_task","type":"string"},"recurrent_task_id":{"$schema":"https://json-schema.org/draft/2019-09/schema","$ref":"#task-rec-id","title":"Recurrent_task_id"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"},"recurrence":{"anyOf":[{"additionalProperties":false,"properties":{"start":{"$schema":"https://json-schema.org/draft/2019-09/schema","$ref":"#date","title":"Start"},"count":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Count","type":"integer"},"rule":{"anyOf":[{"additionalProperties":false,"properties":{"every":{"const":"day","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},{"additionalProperties":false,"properties":{"every":{"const":"month","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"},"day":{"anyOf":[{"$schema":"https://json-schema.org/draft/2019-09/schema","type":"integer"},{"items":[{"anyOf":[{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"monday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"tuesday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"wednesday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"thursday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"friday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"saturday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"sunday","type":"string"}],"$id":"#weekday","$schema":"https://json-schema.org/draft/2019-09/schema","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","type":"integer"}],"$schema":"https://json-schema.org/draft/2019-09/schema","type":"array"}],"$id":"#month_day","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Day","type":["array","integer"]}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},{"additionalProperties":false,"properties":{"every":{"const":"week","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"},"weekdays":{"additionalProperties":false,"properties":{"monday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Monday","default":false,"type":"boolean"},"tuesday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Tuesday","default":false,"type":"boolean"},"wednesday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Wednesday","default":false,"type":"boolean"},"thursday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Thursday","default":false,"type":"boolean"},"friday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Friday","default":false,"type":"boolean"},"saturday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Saturday","default":false,"type":"boolean"},"sunday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Sunday","default":false,"type":"boolean"}},"$id":"#weekdays","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Weekdays","type":"object"}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},{"additionalProperties":false,"properties":{"every":{"const":"workday","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},{"additionalProperties":false,"properties":{"every":{"const":"year","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"},"day":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Day","type":"integer"},"month":{"anyOf":[{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"january","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"february","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"march","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"april","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"may","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"june","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"july","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"august","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"september","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"october","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"november","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"december","type":"string"}],"$id":"#month","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Month","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"}],"$id":"#rule","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Rule","type":"object"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"end":{"$schema":"https://json-schema.org/draft/2019-09/schema","$ref":"#date","title":"End"},"start":{"$schema":"https://json-schema.org/draft/2019-09/schema","$ref":"#date","title":"Start"},"rule":{"anyOf":[{"additionalProperties":false,"properties":{"every":{"const":"day","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},{"additionalProperties":false,"properties":{"every":{"const":"month","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"},"day":{"anyOf":[{"$schema":"https://json-schema.org/draft/2019-09/schema","type":"integer"},{"items":[{"anyOf":[{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"monday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"tuesday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"wednesday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"thursday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"friday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"saturday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"sunday","type":"string"}],"$id":"#weekday","$schema":"https://json-schema.org/draft/2019-09/schema","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","type":"integer"}],"$schema":"https://json-schema.org/draft/2019-09/schema","type":"array"}],"$id":"#month_day","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Day","type":["array","integer"]}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},{"additionalProperties":false,"properties":{"every":{"const":"week","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"},"weekdays":{"additionalProperties":false,"properties":{"monday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Monday","default":false,"type":"boolean"},"tuesday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Tuesday","default":false,"type":"boolean"},"wednesday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Wednesday","default":false,"type":"boolean"},"thursday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Thursday","default":false,"type":"boolean"},"friday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Friday","default":false,"type":"boolean"},"saturday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Saturday","default":false,"type":"boolean"},"sunday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Sunday","default":false,"type":"boolean"}},"$id":"#weekdays","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Weekdays","type":"object"}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},{"additionalProperties":false,"properties":{"every":{"const":"workday","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},{"additionalProperties":false,"properties":{"every":{"const":"year","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"},"day":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Day","type":"integer"},"month":{"anyOf":[{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"january","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"february","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"march","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"april","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"may","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"june","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"july","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"august","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"september","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"october","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"november","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"december","type":"string"}],"$id":"#month","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Month","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"}],"$id":"#rule","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Rule","type":"object"}},"$schema":"https://json-schema.org/draft/2019-09/schema"}],"$id":"#recurrence","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Recurrence","type":"object"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"todo","type":"string"},"checked":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Checked","type":"boolean"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"},"task":{"$id":"#task-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Task","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema"}],"$id":"#block","$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Blocks","type":"array"}},"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Notes","default":null,"type":["null","object"]},"title":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Title","default":null,"type":["null","string"]},"url":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Url","default":null,"type":["null","string"]}},"$id":"#task-patch","$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"}
    */ patch: z
            .object({
              ignored: z.union([z.null(), z.string()]).default(null),
              completed: z.union([z.null(), z.string()]).default(null),
              integration_id: z.string().optional(),
              distant_task_id: z.string().optional(),
              integration_data: z.null().default(null),
              occurrence: z
                .union([
                  z.null(),
                  z
                    .object({
                      date: z
                        .tuple([
                          z.number().int(),
                          z.number().int(),
                          z.number().int(),
                        ])
                        .optional(),
                      recurrence: z.string().optional(),
                    })
                    .strict(),
                ])
                .default(null),
              parent: z
                .union([
                  z.null(),
                  z
                    .object({
                      kind: z
                        .union([
                          z.literal("event"),
                          z.literal("event-rec"),
                          z.literal("page"),
                          z.literal("people"),
                          z.literal("task"),
                          z.literal("task-rec"),
                        ])
                        .optional(),
                      id: z.string().optional(),
                    })
                    .strict(),
                ])
                .default(null),
              scheduled: z
                .union([
                  z.null(),
                  z.null(),
                  z
                    .object({
                      year: z.number().int().optional(),
                      n: z.number().int().optional(),
                    })
                    .strict(),
                  z.any(),
                ])
                .default(null),
              starred: z.union([z.boolean(), z.null()]).default(null),
              notes: z
                .union([
                  z.null(),
                  z
                    .object({
                      blocks: z
                        .array(
                          z.record(z.any()).and(
                            z.union([
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("blockquote").optional(),
                                  content: z.string().optional(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("bullet").optional(),
                                  list_type: z
                                    .union([
                                      z.literal("ordered"),
                                      z.literal("unordered"),
                                    ])
                                    .optional(),
                                  content: z.string().optional(),
                                  depth: z.number().int(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("check").optional(),
                                  checked: z.boolean().optional(),
                                  content: z.string().optional(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("code").optional(),
                                  language: z.string().optional(),
                                  content: z.string().optional(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("callout").optional(),
                                  content: z.string().optional(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("divider").optional(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("embed").optional(),
                                  content: z.string().optional(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("heading").optional(),
                                  content: z.string().optional(),
                                  level: z.number().int().optional(),
                                  retracted: z.boolean(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("paragraph").optional(),
                                  content: z.string().optional(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("query").optional(),
                                  content: z.string().optional(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("recurrent_task").optional(),
                                  recurrent_task_id: z.any().optional(),
                                  content: z.string().optional(),
                                  recurrence: z
                                    .record(z.any())
                                    .and(
                                      z.union([
                                        z
                                          .object({
                                            start: z.any().optional(),
                                            count: z.number().int().optional(),
                                            rule: z
                                              .record(z.any())
                                              .and(
                                                z.union([
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("day")
                                                        .optional(),
                                                      period: z.number().int(),
                                                    })
                                                    .strict(),
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("month")
                                                        .optional(),
                                                      period: z.number().int(),
                                                      day: z
                                                        .union([
                                                          z.number().int(),
                                                          z.tuple([
                                                            z.union([
                                                              z.literal("monday"),
                                                              z.literal("tuesday"),
                                                              z.literal(
                                                                "wednesday"
                                                              ),
                                                              z.literal("thursday"),
                                                              z.literal("friday"),
                                                              z.literal("saturday"),
                                                              z.literal("sunday"),
                                                            ]),
                                                            z.number().int(),
                                                          ]),
                                                        ])
                                                        .optional(),
                                                    })
                                                    .strict(),
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("week")
                                                        .optional(),
                                                      period: z.number().int(),
                                                      weekdays: z
                                                        .object({
                                                          monday: z.boolean(),
                                                          tuesday: z.boolean(),
                                                          wednesday: z.boolean(),
                                                          thursday: z.boolean(),
                                                          friday: z.boolean(),
                                                          saturday: z.boolean(),
                                                          sunday: z.boolean(),
                                                        })
                                                        .strict()
                                                        .optional(),
                                                    })
                                                    .strict(),
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("workday")
                                                        .optional(),
                                                      period: z.number().int(),
                                                    })
                                                    .strict(),
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("year")
                                                        .optional(),
                                                      period: z.number().int(),
                                                      day: z
                                                        .number()
                                                        .int()
                                                        .optional(),
                                                      month: z
                                                        .union([
                                                          z.literal("january"),
                                                          z.literal("february"),
                                                          z.literal("march"),
                                                          z.literal("april"),
                                                          z.literal("may"),
                                                          z.literal("june"),
                                                          z.literal("july"),
                                                          z.literal("august"),
                                                          z.literal("september"),
                                                          z.literal("october"),
                                                          z.literal("november"),
                                                          z.literal("december"),
                                                        ])
                                                        .optional(),
                                                    })
                                                    .strict(),
                                                ])
                                              )
                                              .optional(),
                                          })
                                          .strict(),
                                        z
                                          .object({
                                            end: z.any().optional(),
                                            start: z.any().optional(),
                                            rule: z
                                              .record(z.any())
                                              .and(
                                                z.union([
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("day")
                                                        .optional(),
                                                      period: z.number().int(),
                                                    })
                                                    .strict(),
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("month")
                                                        .optional(),
                                                      period: z.number().int(),
                                                      day: z
                                                        .union([
                                                          z.number().int(),
                                                          z.tuple([
                                                            z.union([
                                                              z.literal("monday"),
                                                              z.literal("tuesday"),
                                                              z.literal(
                                                                "wednesday"
                                                              ),
                                                              z.literal("thursday"),
                                                              z.literal("friday"),
                                                              z.literal("saturday"),
                                                              z.literal("sunday"),
                                                            ]),
                                                            z.number().int(),
                                                          ]),
                                                        ])
                                                        .optional(),
                                                    })
                                                    .strict(),
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("week")
                                                        .optional(),
                                                      period: z.number().int(),
                                                      weekdays: z
                                                        .object({
                                                          monday: z.boolean(),
                                                          tuesday: z.boolean(),
                                                          wednesday: z.boolean(),
                                                          thursday: z.boolean(),
                                                          friday: z.boolean(),
                                                          saturday: z.boolean(),
                                                          sunday: z.boolean(),
                                                        })
                                                        .strict()
                                                        .optional(),
                                                    })
                                                    .strict(),
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("workday")
                                                        .optional(),
                                                      period: z.number().int(),
                                                    })
                                                    .strict(),
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("year")
                                                        .optional(),
                                                      period: z.number().int(),
                                                      day: z
                                                        .number()
                                                        .int()
                                                        .optional(),
                                                      month: z
                                                        .union([
                                                          z.literal("january"),
                                                          z.literal("february"),
                                                          z.literal("march"),
                                                          z.literal("april"),
                                                          z.literal("may"),
                                                          z.literal("june"),
                                                          z.literal("july"),
                                                          z.literal("august"),
                                                          z.literal("september"),
                                                          z.literal("october"),
                                                          z.literal("november"),
                                                          z.literal("december"),
                                                        ])
                                                        .optional(),
                                                    })
                                                    .strict(),
                                                ])
                                              )
                                              .optional(),
                                          })
                                          .strict(),
                                      ])
                                    )
                                    .optional(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("todo").optional(),
                                  checked: z.boolean().optional(),
                                  content: z.string().optional(),
                                  task: z.string().optional(),
                                })
                                .strict(),
                            ])
                          )
                        )
                        .optional(),
                    })
                    .strict(),
                ])
                .default(null),
              title: z.union([z.null(), z.string()]).default(null),
              url: z.union([z.null(), z.string()]).default(null),
            })
            .strict(),
    
          /*
    {"$schema":"https://json-schema.org/draft/2019-09/schema","type":["null","string"]}
    */ confirm: z.union([z.null(), z.string()]),
        },
        async ({ id, patch, confirm }) => {
  • src/tools.ts:908-1333 (registration)
    Registration of the 'taskUpdate' MCP tool using server.tool(), providing description, input schema validator, and inline handler function.
      server.tool(
        "taskUpdate",
        "Patch a task.",
        {
          /*
    {"$id":"#task-id","$schema":"https://json-schema.org/draft/2019-09/schema","type":"string"}
    */ id: z.string(),
    
          /*
    {"additionalProperties":false,"properties":{"ignored":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Ignored","default":null,"type":["null","string"]},"completed":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Completed","default":null,"type":["null","string"]},"integration_id":{"$id":"#integration-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Integration_id","type":"string"},"distant_task_id":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Distant_task_id","type":"string"},"integration_data":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Integration_data","default":null,"type":"null"},"occurrence":{"additionalProperties":false,"properties":{"date":{"items":[{"$schema":"https://json-schema.org/draft/2019-09/schema","type":"integer"},{"$schema":"https://json-schema.org/draft/2019-09/schema","type":"integer"},{"$schema":"https://json-schema.org/draft/2019-09/schema","type":"integer"}],"$id":"#date","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Date","type":"array"},"recurrence":{"$id":"#task-rec-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Recurrence","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Occurrence","default":null,"type":["null","object"]},"parent":{"additionalProperties":false,"properties":{"kind":{"anyOf":[{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"event","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"event-rec","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"page","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"people","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"task","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"task-rec","type":"string"}],"$id":"#kind","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Kind","type":"string"},"id":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Parent","default":null,"type":["null","object"]},"scheduled":{"anyOf":[{"type":"null"},{"type":"null"},{"additionalProperties":false,"properties":{"year":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Year","type":"integer"},"n":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"N","type":"integer"}},"$id":"#week","$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},{"$schema":"https://json-schema.org/draft/2019-09/schema","$ref":"#date"}],"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Scheduled","default":null,"type":["null","object"]},"starred":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Starred","default":null,"type":["boolean","null"]},"notes":{"additionalProperties":false,"properties":{"blocks":{"items":{"anyOf":[{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"blockquote","type":"string"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"bullet","type":"string"},"list_type":{"anyOf":[{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"ordered","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"unordered","type":"string"}],"$id":"#block-list-type","$schema":"https://json-schema.org/draft/2019-09/schema","title":"List_type","type":"string"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"},"depth":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Depth","default":0,"type":"integer"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"check","type":"string"},"checked":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Checked","type":"boolean"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"code","type":"string"},"language":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Language","type":"string"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"callout","type":"string"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"divider","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"embed","type":"string"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"heading","type":"string"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"},"level":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Level","type":"integer"},"retracted":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Retracted","default":false,"type":"boolean"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"paragraph","type":"string"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"query","type":"string"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"recurrent_task","type":"string"},"recurrent_task_id":{"$schema":"https://json-schema.org/draft/2019-09/schema","$ref":"#task-rec-id","title":"Recurrent_task_id"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"},"recurrence":{"anyOf":[{"additionalProperties":false,"properties":{"start":{"$schema":"https://json-schema.org/draft/2019-09/schema","$ref":"#date","title":"Start"},"count":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Count","type":"integer"},"rule":{"anyOf":[{"additionalProperties":false,"properties":{"every":{"const":"day","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},{"additionalProperties":false,"properties":{"every":{"const":"month","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"},"day":{"anyOf":[{"$schema":"https://json-schema.org/draft/2019-09/schema","type":"integer"},{"items":[{"anyOf":[{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"monday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"tuesday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"wednesday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"thursday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"friday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"saturday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"sunday","type":"string"}],"$id":"#weekday","$schema":"https://json-schema.org/draft/2019-09/schema","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","type":"integer"}],"$schema":"https://json-schema.org/draft/2019-09/schema","type":"array"}],"$id":"#month_day","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Day","type":["array","integer"]}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},{"additionalProperties":false,"properties":{"every":{"const":"week","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"},"weekdays":{"additionalProperties":false,"properties":{"monday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Monday","default":false,"type":"boolean"},"tuesday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Tuesday","default":false,"type":"boolean"},"wednesday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Wednesday","default":false,"type":"boolean"},"thursday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Thursday","default":false,"type":"boolean"},"friday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Friday","default":false,"type":"boolean"},"saturday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Saturday","default":false,"type":"boolean"},"sunday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Sunday","default":false,"type":"boolean"}},"$id":"#weekdays","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Weekdays","type":"object"}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},{"additionalProperties":false,"properties":{"every":{"const":"workday","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},{"additionalProperties":false,"properties":{"every":{"const":"year","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"},"day":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Day","type":"integer"},"month":{"anyOf":[{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"january","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"february","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"march","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"april","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"may","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"june","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"july","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"august","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"september","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"october","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"november","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"december","type":"string"}],"$id":"#month","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Month","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"}],"$id":"#rule","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Rule","type":"object"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"end":{"$schema":"https://json-schema.org/draft/2019-09/schema","$ref":"#date","title":"End"},"start":{"$schema":"https://json-schema.org/draft/2019-09/schema","$ref":"#date","title":"Start"},"rule":{"anyOf":[{"additionalProperties":false,"properties":{"every":{"const":"day","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},{"additionalProperties":false,"properties":{"every":{"const":"month","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"},"day":{"anyOf":[{"$schema":"https://json-schema.org/draft/2019-09/schema","type":"integer"},{"items":[{"anyOf":[{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"monday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"tuesday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"wednesday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"thursday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"friday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"saturday","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"sunday","type":"string"}],"$id":"#weekday","$schema":"https://json-schema.org/draft/2019-09/schema","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","type":"integer"}],"$schema":"https://json-schema.org/draft/2019-09/schema","type":"array"}],"$id":"#month_day","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Day","type":["array","integer"]}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},{"additionalProperties":false,"properties":{"every":{"const":"week","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"},"weekdays":{"additionalProperties":false,"properties":{"monday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Monday","default":false,"type":"boolean"},"tuesday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Tuesday","default":false,"type":"boolean"},"wednesday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Wednesday","default":false,"type":"boolean"},"thursday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Thursday","default":false,"type":"boolean"},"friday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Friday","default":false,"type":"boolean"},"saturday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Saturday","default":false,"type":"boolean"},"sunday":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Sunday","default":false,"type":"boolean"}},"$id":"#weekdays","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Weekdays","type":"object"}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},{"additionalProperties":false,"properties":{"every":{"const":"workday","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},{"additionalProperties":false,"properties":{"every":{"const":"year","type":"string"},"period":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Period","default":1,"type":"integer"},"day":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Day","type":"integer"},"month":{"anyOf":[{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"january","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"february","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"march","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"april","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"may","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"june","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"july","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"august","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"september","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"october","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"november","type":"string"},{"$schema":"https://json-schema.org/draft/2019-09/schema","const":"december","type":"string"}],"$id":"#month","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Month","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"}],"$id":"#rule","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Rule","type":"object"}},"$schema":"https://json-schema.org/draft/2019-09/schema"}],"$id":"#recurrence","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Recurrence","type":"object"}},"$schema":"https://json-schema.org/draft/2019-09/schema"},{"additionalProperties":false,"properties":{"id":{"$id":"#block-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Id","type":"string"},"type":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Type","const":"todo","type":"string"},"checked":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Checked","type":"boolean"},"content":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Content","type":"string"},"task":{"$id":"#task-id","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Task","type":"string"}},"$schema":"https://json-schema.org/draft/2019-09/schema"}],"$id":"#block","$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"},"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Blocks","type":"array"}},"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Notes","default":null,"type":["null","object"]},"title":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Title","default":null,"type":["null","string"]},"url":{"$schema":"https://json-schema.org/draft/2019-09/schema","title":"Url","default":null,"type":["null","string"]}},"$id":"#task-patch","$schema":"https://json-schema.org/draft/2019-09/schema","type":"object"}
    */ patch: z
            .object({
              ignored: z.union([z.null(), z.string()]).default(null),
              completed: z.union([z.null(), z.string()]).default(null),
              integration_id: z.string().optional(),
              distant_task_id: z.string().optional(),
              integration_data: z.null().default(null),
              occurrence: z
                .union([
                  z.null(),
                  z
                    .object({
                      date: z
                        .tuple([
                          z.number().int(),
                          z.number().int(),
                          z.number().int(),
                        ])
                        .optional(),
                      recurrence: z.string().optional(),
                    })
                    .strict(),
                ])
                .default(null),
              parent: z
                .union([
                  z.null(),
                  z
                    .object({
                      kind: z
                        .union([
                          z.literal("event"),
                          z.literal("event-rec"),
                          z.literal("page"),
                          z.literal("people"),
                          z.literal("task"),
                          z.literal("task-rec"),
                        ])
                        .optional(),
                      id: z.string().optional(),
                    })
                    .strict(),
                ])
                .default(null),
              scheduled: z
                .union([
                  z.null(),
                  z.null(),
                  z
                    .object({
                      year: z.number().int().optional(),
                      n: z.number().int().optional(),
                    })
                    .strict(),
                  z.any(),
                ])
                .default(null),
              starred: z.union([z.boolean(), z.null()]).default(null),
              notes: z
                .union([
                  z.null(),
                  z
                    .object({
                      blocks: z
                        .array(
                          z.record(z.any()).and(
                            z.union([
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("blockquote").optional(),
                                  content: z.string().optional(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("bullet").optional(),
                                  list_type: z
                                    .union([
                                      z.literal("ordered"),
                                      z.literal("unordered"),
                                    ])
                                    .optional(),
                                  content: z.string().optional(),
                                  depth: z.number().int(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("check").optional(),
                                  checked: z.boolean().optional(),
                                  content: z.string().optional(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("code").optional(),
                                  language: z.string().optional(),
                                  content: z.string().optional(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("callout").optional(),
                                  content: z.string().optional(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("divider").optional(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("embed").optional(),
                                  content: z.string().optional(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("heading").optional(),
                                  content: z.string().optional(),
                                  level: z.number().int().optional(),
                                  retracted: z.boolean(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("paragraph").optional(),
                                  content: z.string().optional(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("query").optional(),
                                  content: z.string().optional(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("recurrent_task").optional(),
                                  recurrent_task_id: z.any().optional(),
                                  content: z.string().optional(),
                                  recurrence: z
                                    .record(z.any())
                                    .and(
                                      z.union([
                                        z
                                          .object({
                                            start: z.any().optional(),
                                            count: z.number().int().optional(),
                                            rule: z
                                              .record(z.any())
                                              .and(
                                                z.union([
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("day")
                                                        .optional(),
                                                      period: z.number().int(),
                                                    })
                                                    .strict(),
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("month")
                                                        .optional(),
                                                      period: z.number().int(),
                                                      day: z
                                                        .union([
                                                          z.number().int(),
                                                          z.tuple([
                                                            z.union([
                                                              z.literal("monday"),
                                                              z.literal("tuesday"),
                                                              z.literal(
                                                                "wednesday"
                                                              ),
                                                              z.literal("thursday"),
                                                              z.literal("friday"),
                                                              z.literal("saturday"),
                                                              z.literal("sunday"),
                                                            ]),
                                                            z.number().int(),
                                                          ]),
                                                        ])
                                                        .optional(),
                                                    })
                                                    .strict(),
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("week")
                                                        .optional(),
                                                      period: z.number().int(),
                                                      weekdays: z
                                                        .object({
                                                          monday: z.boolean(),
                                                          tuesday: z.boolean(),
                                                          wednesday: z.boolean(),
                                                          thursday: z.boolean(),
                                                          friday: z.boolean(),
                                                          saturday: z.boolean(),
                                                          sunday: z.boolean(),
                                                        })
                                                        .strict()
                                                        .optional(),
                                                    })
                                                    .strict(),
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("workday")
                                                        .optional(),
                                                      period: z.number().int(),
                                                    })
                                                    .strict(),
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("year")
                                                        .optional(),
                                                      period: z.number().int(),
                                                      day: z
                                                        .number()
                                                        .int()
                                                        .optional(),
                                                      month: z
                                                        .union([
                                                          z.literal("january"),
                                                          z.literal("february"),
                                                          z.literal("march"),
                                                          z.literal("april"),
                                                          z.literal("may"),
                                                          z.literal("june"),
                                                          z.literal("july"),
                                                          z.literal("august"),
                                                          z.literal("september"),
                                                          z.literal("october"),
                                                          z.literal("november"),
                                                          z.literal("december"),
                                                        ])
                                                        .optional(),
                                                    })
                                                    .strict(),
                                                ])
                                              )
                                              .optional(),
                                          })
                                          .strict(),
                                        z
                                          .object({
                                            end: z.any().optional(),
                                            start: z.any().optional(),
                                            rule: z
                                              .record(z.any())
                                              .and(
                                                z.union([
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("day")
                                                        .optional(),
                                                      period: z.number().int(),
                                                    })
                                                    .strict(),
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("month")
                                                        .optional(),
                                                      period: z.number().int(),
                                                      day: z
                                                        .union([
                                                          z.number().int(),
                                                          z.tuple([
                                                            z.union([
                                                              z.literal("monday"),
                                                              z.literal("tuesday"),
                                                              z.literal(
                                                                "wednesday"
                                                              ),
                                                              z.literal("thursday"),
                                                              z.literal("friday"),
                                                              z.literal("saturday"),
                                                              z.literal("sunday"),
                                                            ]),
                                                            z.number().int(),
                                                          ]),
                                                        ])
                                                        .optional(),
                                                    })
                                                    .strict(),
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("week")
                                                        .optional(),
                                                      period: z.number().int(),
                                                      weekdays: z
                                                        .object({
                                                          monday: z.boolean(),
                                                          tuesday: z.boolean(),
                                                          wednesday: z.boolean(),
                                                          thursday: z.boolean(),
                                                          friday: z.boolean(),
                                                          saturday: z.boolean(),
                                                          sunday: z.boolean(),
                                                        })
                                                        .strict()
                                                        .optional(),
                                                    })
                                                    .strict(),
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("workday")
                                                        .optional(),
                                                      period: z.number().int(),
                                                    })
                                                    .strict(),
                                                  z
                                                    .object({
                                                      every: z
                                                        .literal("year")
                                                        .optional(),
                                                      period: z.number().int(),
                                                      day: z
                                                        .number()
                                                        .int()
                                                        .optional(),
                                                      month: z
                                                        .union([
                                                          z.literal("january"),
                                                          z.literal("february"),
                                                          z.literal("march"),
                                                          z.literal("april"),
                                                          z.literal("may"),
                                                          z.literal("june"),
                                                          z.literal("july"),
                                                          z.literal("august"),
                                                          z.literal("september"),
                                                          z.literal("october"),
                                                          z.literal("november"),
                                                          z.literal("december"),
                                                        ])
                                                        .optional(),
                                                    })
                                                    .strict(),
                                                ])
                                              )
                                              .optional(),
                                          })
                                          .strict(),
                                      ])
                                    )
                                    .optional(),
                                })
                                .strict(),
                              z
                                .object({
                                  id: z.string().optional(),
                                  type: z.literal("todo").optional(),
                                  checked: z.boolean().optional(),
                                  content: z.string().optional(),
                                  task: z.string().optional(),
                                })
                                .strict(),
                            ])
                          )
                        )
                        .optional(),
                    })
                    .strict(),
                ])
                .default(null),
              title: z.union([z.null(), z.string()]).default(null),
              url: z.union([z.null(), z.string()]).default(null),
            })
            .strict(),
    
          /*
    {"$schema":"https://json-schema.org/draft/2019-09/schema","type":["null","string"]}
    */ confirm: z.union([z.null(), z.string()]),
        },
        async ({ id, patch, confirm }) => {
          try {
            const data = await sendRpcRequest("task.update", [id, patch, confirm]);
            return {
              content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
            };
          } catch (error) {
            logger.error("Error fetching task.update: %o", error);
            return {
              content: [
                {
                  type: "text",
                  text: `Error fetching auth id: ${error instanceof Error ? error.message : String(error)}`,
                },
              ],
              isError: true,
            };
          }
        }
      );
  • src/index.ts:234-234 (registration)
    Top-level call to registerServerTools function, which registers all server tools including 'taskUpdate'.
    registerServerTools(server, sendRpcRequest, logger);
Install Server

Other Tools

Related 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/routineco/mcp-server'

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