Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

Update Routine

Use this to change a Routine's interval or to enable or disable it.

MCP name: update_routine

Tool contract

{
  "annotations": {
    "destructiveHint": false,
    "openWorldHint": true,
    "readOnlyHint": false,
    "title": "Update Routine"
  },
  "description": "Use this to change a Routine's interval or to enable or disable it.",
  "execution": {
    "taskSupport": "forbidden"
  },
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
      "enabled": {
        "description": "`true` re-enables the Routine and resets its consecutive-failure counter; `false` disables it (owner-disabled)",
        "type": "boolean"
      },
      "interval": {
        "description": "New schedule interval",
        "enum": [
          "hourly",
          "daily",
          "weekly"
        ],
        "type": "string"
      },
      "routine_id": {
        "description": "The Routine id (`routine_<uuid>` form) to update",
        "minLength": 1,
        "type": "string"
      }
    },
    "required": [
      "routine_id"
    ],
    "type": "object"
  },
  "name": "update_routine",
  "outputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "advisories": {
        "description": "Structured non-fatal advisories, including authoring issues and unread staff feedback responses. Each advisory.summary is also appended to the text content for the LLM path.",
        "items": {
          "additionalProperties": false,
          "properties": {
            "data": {
              "additionalProperties": {},
              "description": "Kind-specific structured payload. Shape varies per advisory kind.",
              "propertyNames": {
                "type": "string"
              },
              "type": "object"
            },
            "doc_url": {
              "description": "Optional docs pointer for this advisory kind.",
              "type": "string"
            },
            "kind": {
              "description": "Stable advisory identifier (e.g. \"legacy-bridge\").",
              "type": "string"
            },
            "severity": {
              "description": "Severity; omitted advisories are treated as 'info'.",
              "enum": [
                "info",
                "warn"
              ],
              "type": "string"
            },
            "summary": {
              "description": "Agent-facing summary. Self-sufficient; no extra context required.",
              "type": "string"
            },
            "userSummary": {
              "description": "End-user-facing summary. Set when the advisory should render in-app.",
              "type": "string"
            }
          },
          "required": [
            "kind",
            "summary"
          ],
          "type": "object"
        },
        "type": "array"
      },
      "ok": {
        "const": true,
        "description": "Indicates success. Errors arrive as content with isError:true.",
        "type": "boolean"
      },
      "routine": {
        "additionalProperties": false,
        "properties": {
          "app_id": {
            "description": "UUID of the app this Routine runs on.",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "type": "string"
          },
          "consecutive_failures": {
            "description": "Consecutive failed ticks since the last success. Resets to 0 on success; the Routine auto-disables at 5.",
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": "integer"
          },
          "disabled_reason": {
            "anyOf": [
              {
                "enum": [
                  "owner",
                  "auto"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the Routine is disabled: `owner` (manually) or `auto` (5 consecutive failures). `null` when enabled."
          },
          "enabled": {
            "description": "`false` when the Routine is disabled (owner-disabled or auto-disabled).",
            "type": "boolean"
          },
          "id": {
            "description": "Public Routine id, `routine_<uuid>` form. Use this with update_routine/delete_routine.",
            "type": "string"
          },
          "interval": {
            "description": "How often the Routine runs.",
            "enum": [
              "hourly",
              "daily",
              "weekly"
            ],
            "type": "string"
          },
          "last_error": {
            "anyOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "details": {
                    "additionalProperties": false,
                    "description": "Present when `kind` is `timeout`: which time limit stopped the run (`operation`, the op wall clock, or `sealed_fetch`, a sealed `env.fetch` deadline), the limit in ms, how long the run went in ms, and where the time went.",
                    "properties": {
                      "elapsedMs": {
                        "type": "number"
                      },
                      "limit": {
                        "enum": [
                          "operation",
                          "sealed_fetch"
                        ],
                        "type": "string"
                      },
                      "limitMs": {
                        "type": "number"
                      },
                      "timings": {
                        "additionalProperties": false,
                        "description": "Where the run spent its time, when the host measured it: `wallMs`, the storage calls it made and the ms at least one was in flight, the sealed fetch calls the host made for it and their ms (a fetch from `charming:network/[email protected]` is not counted), and how many other Routines of the same App ran alongside it and for how many ms.",
                        "properties": {
                          "fetch": {
                            "additionalProperties": false,
                            "properties": {
                              "count": {
                                "type": "number"
                              },
                              "ms": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "count",
                              "ms"
                            ],
                            "type": "object"
                          },
                          "overlappingRoutines": {
                            "additionalProperties": false,
                            "properties": {
                              "count": {
                                "type": "number"
                              },
                              "ms": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "count",
                              "ms"
                            ],
                            "type": "object"
                          },
                          "storage": {
                            "additionalProperties": false,
                            "properties": {
                              "calls": {
                                "type": "number"
                              },
                              "ms": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "calls",
                              "ms"
                            ],
                            "type": "object"
                          },
                          "wallMs": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "wallMs",
                          "storage",
                          "fetch",
                          "overlappingRoutines"
                        ],
                        "type": "object"
                      }
                    },
                    "required": [
                      "limit",
                      "limitMs",
                      "elapsedMs"
                    ],
                    "type": "object"
                  },
                  "kind": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "kind",
                  "message"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Classified failure detail from the most recent failed tick, reusing the sandbox executor's failure classification, truncated with the stack always dropped. `null` on success or if never run."
          },
          "last_outcome": {
            "description": "Result of the most recent tick (`success` or `failure`). `null` if this Routine has never run.",
            "type": [
              "string",
              "null"
            ]
          },
          "last_run_at": {
            "description": "ISO-8601 timestamp of the most recent tick. `null` if this Routine has never run.",
            "type": [
              "string",
              "null"
            ]
          },
          "next_run_at": {
            "description": "ISO-8601 timestamp of the next scheduled run. `null` while the Routine is disabled — the underlying schedule is preserved and reappears here once re-enabled, with no recomputation.",
            "type": [
              "string",
              "null"
            ]
          },
          "op": {
            "description": "The target op this Routine invokes with empty input.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "app_id",
          "op",
          "interval",
          "enabled",
          "disabled_reason",
          "next_run_at",
          "last_run_at",
          "last_outcome",
          "last_error",
          "consecutive_failures"
        ],
        "type": "object"
      }
    },
    "required": [
      "ok",
      "routine"
    ],
    "type": "object"
  }
}

Was this page helpful?