set_app_size #

View this page as Markdown

On this page

Generated automatically from the published contract sources.

A script calls this action over HTTPS at POST https://tzcloud.dev.turnzero.ai/v1/set_app_size, with a bearer credential and the action's payload as the JSON body. An MCP connection lists this action as the tool tzcloud_set_app_size.

OAuth access tokens and minted tokens, including the turnzero command's computer token, are bearer credentials. The action determines which kinds, scopes and grants it accepts (Sign-in, sessions, and tokens).

Build metadata: Registered in this build. Registration describes the default dispatcher in this build. It does not guarantee that a caller has the required credential or grant, that a tool is listed for that connection, or that the required service is configured.

Contract description #

Set your application's size, production sleep, or whether development runs at that size. The account owner must have requested or agreed to the change. Ask only for a choice needed to make the requested change. If nobody can answer, leave the requested change unapplied and report why. A deployed production size change normally re-creates compute, with one cold start outside the request path. When one call changes the size and turns production sleep off, any production re-creation applies both changes at once. With applying, a change is still in progress. Read read_status with wait_seconds for completion and the settings in effect.

Kind is fixed at creation. Changing size changes production's charge to that size's rate key. A size-only move keeps production's sleep setting on shared, saving it if unset. A move to dedicated records sleep off. At waiting_for_node, tell the owner their server is starting. Read the setting as production_sleep in read_status.

More about this action #

In production, shared-0.5gb has 0.25 vCPU and 0.5 GiB of memory. shared-1gb has 0.5 vCPU and 1 GiB. Neither size scales beyond one replica or includes usage capacity. The larger size runs production in its own container, and the smaller normally runs it as a pod with its own CPU and memory limits in a shared group. Read read_status's production_sleep for the setting in effect, whether recorded or defaulted; size alone does not determine the default. Sleeping accepts a cold first request.

Dedicated 4 GB (dedicated-4gb) and Dedicated 8 GB (dedicated-8gb) reserve CPU and memory for production on a machine shared with other dedicated servers. Only unbilled accounts can choose them until they go on sale. Production stays awake. It can restart during a weekly maintenance window if its machine is reimaged. Development remains shared.

A move to a dedicated size, a move between dedicated sizes, or a move back to shared starts a new production copy. The production address stays the same. Any copy already serving keeps taking traffic until the new copy passes its health check and takes traffic. While deploy.step is waiting_for_node, tell the owner that Turn Zero is starting a machine or waiting for room on one. Read the time waited from deploy.step_started_at. If the new copy gets no machine within 15 minutes, the version fails with node_unavailable. The previous settings and any serving version stay in place.

With development_at_size true, development uses production's shared size. It uses that size's CPU and memory limits and awake-time rate key. Development keeps its own placement and service limits and still sleeps when idle. A development pod stays in its development group and uses the group's CPU and memory requests.

With the default development pod settings, the CPU limit falls from 1 vCPU to 0.5 vCPU at shared-1gb or 0.25 vCPU at shared-0.5gb. A development container at shared-0.5gb keeps its existing CPU and memory limits.

Pass at least one of size, production_sleep, and development_at_size. Null is treated as omitted for all three. changed lists values already recorded. With applying, application still gives the previous value of a setting that awaits its redeploy. The redeploy records that setting when its compute takes traffic. An unchanged value writes nothing.

Changing development_at_size places deployed development again. The record follows the compute. If development is off or not deployed, the choice is recorded for its first placement.

Turn off development matching and wait for it to finish before moving production to any other size. A move with matching still on, or one that also turns matching on, returns development_at_size_set. If production is dedicated, turn matching on only after a separate move back to shared has finished.

Read read_status with wait_seconds, following applying.environment and applying.version, for completion and the settings then held. When one call starts both redeploys, applying gives production’s version, so read read_status with wait_seconds until settled is true, then check both settings. Failed re-creation reads failed while production serves its earlier compute; the same call retries it. Do not repeat the act merely to confirm.

On a serverless application, this action refuses serverless_unsupported before its other reads. On an application without a server size, setting development_at_size refuses invalid_request. For a server, invalid_request covers a sleep setting alone without a held size, a request with none of the three changes, an unknown size, a non-boolean setting, turning sleep on for dedicated production, or enabling development matching while production holds a dedicated size. no_such_application means the id is absent from your account. deploy_in_flight means a production version is still running, or a development version is still running while you are changing its size setting. Read read_status with wait_seconds for the environment named in the refusal. Retry after the version ends. A sleep-only change may carry the compute's own refusal; a failed write is entitlement_apply_failed, retried with the same call.

On a size move, plan_schedule_conflict means standing schedules do not fit the target. Unset quantities and unresolved placement carry their own refusals. target_environment_halted means production is halted; deploy_seam_absent means no live provider seam is bound. entitlement_apply_failed covers a failed compute or connection-limit write, and re-creation may refuse to start by name. Passed-through refusals keep the underlying act's name and detail.

An application's kind is fixed at creation. For work that needs a server under skill:deploy's kind rule, read skill:deploy:new-server. Choose the new server's size through skill:deploy:prepare. Create it with create_application, that size and its own manifest, then adapt, transfer any needed data and deploy there. The platform carries over no hostname, database, files or secrets. Keep the original until the owner asks to remove it.

A move to a shared size changes production's awake-time charge to the chosen rate key, server-shared-0.5gb or server-shared-1gb. Both draw the account's Free Allowance first. Production with sleep off stays awake all month, except while the account is paused. It draws its size's rate key for its awake time. With sleep on, production draws for the time it is awake. A completed size-only move to shared keeps the production sleep setting in effect and records it if previously defaulted. When one call changes the size and turns production sleep off, any production re-creation applies both changes at once. The setting is returned as production_sleep by the act and by read_status. Development uses server-shared-0.5gb unless development_at_size is true. With the choice on, it uses the current size's rate key for its awake time.

A dedicated size has a daily rate. While these sizes are open to unbilled accounts only, the billing run records the daily amount without drawing from the account's balance. If a billed account requests a move to dedicated, the action returns size_not_open and keeps production at its current size.

Access and action metadata #

{
  "name": "set_app_size",
  "resource": "application",
  "tier": "reversible",
  "surface": "tzcloud",
  "addresses": [
    "tzcloud"
  ],
  "product": "cloud",
  "clients": [
    "bearer",
    "browser_session"
  ],
  "summary": "Change your application’s size, whether production sleeps when idle, or whether development runs at the application’s size. Make changes only at the account owner’s request. Ask only for a choice needed to make the requested change. If nobody can answer, leave the requested change unapplied and report why. A deployed production size change normally re-creates compute, with one cold start outside the request path. When one call changes the size and turns production sleep off, any production re-creation applies both changes at once.\n\nIn production, `shared-0.5gb` has 0.25 vCPU and 0.5 GiB of memory. `shared-1gb` has 0.5 vCPU and 1 GiB. Neither size scales beyond one replica or includes usage capacity. Smaller production uses shared compute; larger production has its own container. Read `read_status`'s `production_sleep` for the setting in effect, whether recorded or defaulted; size alone does not determine the default. Sleeping accepts a cold first request. With `development_at_size` true, development uses production’s shared size limits. Development still sleeps when idle.\n\nDedicated 4 GB (`dedicated-4gb`) and Dedicated 8 GB (`dedicated-8gb`) reserve CPU and memory for production on a machine shared with other dedicated servers. Only unbilled accounts can choose them until they go on sale. Production stays awake. It can restart during a weekly maintenance window if its machine is reimaged. Development remains shared.\n\nA move to a dedicated size, a move between dedicated sizes, or a move back to shared starts a new production copy. The production address stays the same. Any copy already serving keeps taking traffic until the new copy passes its health check and takes traffic. While `deploy.step` is `waiting_for_node`, tell the owner that Turn Zero is starting a machine or waiting for room on one. Read the time waited from `deploy.step_started_at`. If the new copy gets no machine within 15 minutes, the version fails with `node_unavailable`. The previous settings and any serving version stay in place.\n\nPass at least one of `size`, `production_sleep`, and `development_at_size`. Null is treated as omitted. `changed` lists values already recorded. With `applying`, `application` still gives the previous value of each setting that awaits its redeploy. The redeploy records its setting when the new compute takes traffic. An unchanged value writes nothing.\n\nRead `read_status` with `wait_seconds`, following `applying.environment` and `applying.version`, for completion and the settings then held. When one call starts both redeploys, `applying` gives production’s version, so read `read_status` with `wait_seconds` until `settled` is true, then check both settings. Failed re-creation reads `failed` while production serves its earlier compute; the same call retries it. Do not repeat the act merely to confirm.\n\nFor a server, `invalid_request` covers a sleep setting alone without a held size, a request with none of the three changes, an unknown size, a non-boolean setting, turning sleep on for dedicated production, or enabling development matching while production holds a dedicated size. `no_such_application` means the id is absent from your account. `deploy_in_flight` means production is deploying, or development is deploying while you are changing its size setting. Read `read_status` with `wait_seconds` for the environment in the refusal, then retry after that version ends. A sleep-only change may carry the compute's own refusal; a failed write is `entitlement_apply_failed`, retried with the same call.\n\nOn a size move, `plan_schedule_conflict` means standing schedules do not fit the target. Unset quantities and unresolved placement carry their own refusals. `target_environment_halted` means production is halted; `deploy_seam_absent` means no live provider seam is bound. `entitlement_apply_failed` covers a failed compute or connection-limit write, and re-creation may refuse to start by name. Passed-through refusals keep the underlying act's name and detail.\n\nTurn off development matching and wait for it to finish before moving production to any other size. A move with matching still on, or one that also turns matching on, returns `development_at_size_set`. If production is dedicated, turn matching on only after a separate move back to shared has finished. A billed account that requests a move to dedicated receives `size_not_open` and production keeps its size. A completed move to dedicated records `production_sleep: false`.",
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": true,
    "openWorldHint": true
  }
}

MCP catalog entry #

{
  "name": "set_app_size",
  "title": "Set application size",
  "tier": "reversible",
  "scenario": "CHI-L0-09",
  "summary": "Set your application's size, production sleep, or whether development runs at that size. The account owner must have requested or agreed to the change. Ask only for a choice needed to make the requested change. If nobody can answer, leave the requested change unapplied and report why. A deployed production size change normally re-creates compute, with one cold start outside the request path. When one call changes the size and turns production sleep off, any production re-creation applies both changes at once. With `applying`, a change is still in progress. Read `read_status` with `wait_seconds` for completion and the settings in effect.\n\nKind is fixed at creation. Changing size changes production's charge to that size's rate key. A size-only move keeps production's sleep setting on shared, saving it if unset. A move to dedicated records sleep off. At `waiting_for_node`, tell the owner their server is starting. Read the setting as `production_sleep` in `read_status`.",
  "owners": [
    "API-L0-28",
    "ACB-L0-22",
    "PRC-L0-04",
    "PRC-L0-05",
    "PLD-L0-63",
    "PLD-L0-84"
  ]
}

request #

JSON pointer Description and constraints
"" (root) Type: object
Required fields: ["application"]
/properties/application Your account's application id from list_applications, not its name or label.

Type: string
/properties/size The size to use for production. Choose a shared size or, for an unbilled account, a dedicated size. Omit or use null to keep the size.

Type: string
Allowed values: ["shared-0.5gb","shared-1gb","dedicated-4gb","dedicated-8gb"]
/properties/production_sleep Whether shared production sleeps when idle. On shared, omitting this field or passing null keeps the current setting. Moves to dedicated set this to false. Dedicated production cannot sleep.

Type: boolean
/properties/development_at_size True gives development production's shared CPU and memory limits and awake-time rate. False restores the defaults. Leave this off for a size move or while production is dedicated. Omit or use null to keep the choice.

Type: boolean

response #

JSON pointer Description and constraints
"" (root) Type: object
Required fields: ["contract_version","application","changed","compute"]
/properties/contract_version Required value: 1
/properties/reference The short reference the platform recorded your call under: ten lowercase hexadecimal characters, the value in the call’s record row. Quote it when you report the call.

Type: string
Pattern: ^[0-9a-f]{10}$
/properties/application The recorded application values. If a setting is still applying, its previous value remains here.

Type: object
Required fields: ["id","size","production_sleep","development_at_size"]
/properties/application/properties/id The application id.

Type: string
/properties/application/properties/size The recorded application size; null on the company's own applications, beside unlimited.

/properties/application/properties/size/anyOf/0 $ref: #/shapes/app_size
/properties/application/properties/size/anyOf/1 Type: null
/properties/application/properties/production_sleep The recorded production sleep setting.

Type: boolean
/properties/application/properties/development_at_size The recorded choice for a sized server. While a development apply is pending this still gives the previous value.

Type: boolean
/properties/application/properties/unlimited True on the company's own applications, where size is null. Absent on every other application.

Type: boolean
/properties/changed The size or settings this call recorded. Empty where it recorded nothing.

Type: array
/properties/changed/items Type: string
Allowed values: ["size","production_sleep","development_at_size"]
/properties/compute Results by environment for changes to production sleep and the development size setting. Empty for a size move.

Type: array
/properties/compute/items Type: object
Required fields: ["environment","outcome"]
/properties/compute/items/properties/environment The environment this result applies to.

Type: string
Allowed values: ["development","production"]
/properties/compute/items/properties/outcome The result: unchanged, no_compute, floor_written or redeploy_started.

Type: string
Allowed values: ["unchanged","no_compute","floor_written","redeploy_started"]
/properties/applying Present while a redeploy applies a requested change. The value it carries is recorded when that redeploy takes traffic.

Type: object
Required fields: ["environment","version"]
/properties/applying/properties/size The requested size, present where the size changes. For dedicated production, the new copy can wait for a machine. Follow this version with read_status.

$ref: #/shapes/app_size
/properties/applying/properties/production_sleep The requested sleep setting, present where it changes.

Type: boolean
/properties/applying/properties/environment The environment of this redeploy. If both environments start redeploys, this is production.

Type: string
Allowed values: ["production","development"]
/properties/applying/properties/version The redeploy version in applying.environment. If both environments start redeploys, read read_status with wait_seconds until settled is true.

Type: integer
/properties/applying/properties/development_at_size The development size choice requested for the pending redeploy.

Type: boolean

Complete payload contract #

{
  "request": {
    "type": "object",
    "required": [
      "application"
    ],
    "properties": {
      "application": {
        "type": "string",
        "description": "Your account's application `id` from `list_applications`, not its name or label."
      },
      "size": {
        "type": "string",
        "enum": [
          "shared-0.5gb",
          "shared-1gb",
          "dedicated-4gb",
          "dedicated-8gb"
        ],
        "description": "The size to use for production. Choose a shared size or, for an unbilled account, a dedicated size. Omit or use null to keep the size."
      },
      "production_sleep": {
        "type": "boolean",
        "description": "Whether shared production sleeps when idle. On shared, omitting this field or passing null keeps the current setting. Moves to dedicated set this to false. Dedicated production cannot sleep."
      },
      "development_at_size": {
        "type": "boolean",
        "description": "True gives development production's shared CPU and memory limits and awake-time rate. False restores the defaults. Leave this off for a size move or while production is dedicated. Omit or use null to keep the choice."
      }
    }
  },
  "response": {
    "type": "object",
    "required": [
      "contract_version",
      "application",
      "changed",
      "compute"
    ],
    "properties": {
      "contract_version": {
        "const": 1
      },
      "reference": {
        "type": "string",
        "pattern": "^[0-9a-f]{10}$",
        "description": "The short reference the platform recorded your call under: ten lowercase hexadecimal characters, the value in the call’s record row. Quote it when you report the call."
      },
      "application": {
        "type": "object",
        "required": [
          "id",
          "size",
          "production_sleep",
          "development_at_size"
        ],
        "description": "The recorded application values. If a setting is still applying, its previous value remains here.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The application id."
          },
          "size": {
            "anyOf": [
              {
                "$ref": "#/shapes/app_size"
              },
              {
                "type": "null"
              }
            ],
            "description": "The recorded application size; null on the company's own applications, beside `unlimited`."
          },
          "production_sleep": {
            "type": "boolean",
            "description": "The recorded production sleep setting."
          },
          "development_at_size": {
            "type": "boolean",
            "description": "The recorded choice for a sized server. While a development apply is pending this still gives the previous value."
          },
          "unlimited": {
            "type": "boolean",
            "description": "True on the company's own applications, where `size` is null. Absent on every other application."
          }
        }
      },
      "changed": {
        "type": "array",
        "items": {
          "type": "string",
          "enum": [
            "size",
            "production_sleep",
            "development_at_size"
          ]
        },
        "description": "The size or settings this call recorded. Empty where it recorded nothing."
      },
      "compute": {
        "type": "array",
        "description": "Results by environment for changes to production sleep and the development size setting. Empty for a size move.",
        "items": {
          "type": "object",
          "required": [
            "environment",
            "outcome"
          ],
          "properties": {
            "environment": {
              "type": "string",
              "enum": [
                "development",
                "production"
              ],
              "description": "The environment this result applies to."
            },
            "outcome": {
              "type": "string",
              "enum": [
                "unchanged",
                "no_compute",
                "floor_written",
                "redeploy_started"
              ],
              "description": "The result: unchanged, no_compute, floor_written or redeploy_started."
            }
          }
        }
      },
      "applying": {
        "type": "object",
        "description": "Present while a redeploy applies a requested change. The value it carries is recorded when that redeploy takes traffic.",
        "required": [
          "environment",
          "version"
        ],
        "properties": {
          "size": {
            "$ref": "#/shapes/app_size",
            "description": "The requested size, present where the size changes. For dedicated production, the new copy can wait for a machine. Follow this version with read_status."
          },
          "production_sleep": {
            "type": "boolean",
            "description": "The requested sleep setting, present where it changes."
          },
          "environment": {
            "type": "string",
            "enum": [
              "production",
              "development"
            ],
            "description": "The environment of this redeploy. If both environments start redeploys, this is production."
          },
          "version": {
            "type": "integer",
            "description": "The redeploy version in `applying.environment`. If both environments start redeploys, read `read_status` with `wait_seconds` until `settled` is true."
          },
          "development_at_size": {
            "type": "boolean",
            "description": "The development size choice requested for the pending redeploy."
          }
        }
      }
    }
  }
}

Shared contracts #