delete_environment #

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.turnzero.ai/v1/delete_environment, with a bearer credential and the action's payload as the JSON body. An MCP connection lists this action as the tool tzcloud_delete_environment.

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 #

Delete an application's development environment and everything running or stored in it: its container, database, realm, credentials, files, and logs. Its versions are withdrawn from list_versions. The call keeps the application, its production environment, its areas, and its declarations. Production is deleted only with its application. Afterwards the application has one environment, so a deploy goes to production. With one environment, the call is accepted only where development's records remain. These are a database setup, whole or stopped partway, a deletion of them that stopped, or a record an earlier version of the platform left. It then erases them, the secrets, files, and logs kept for local runs among them, and the next submit_manifest sets the database up again. Otherwise it is refused environment_not_created. Destructive: completes only after a person approves it in the browser.

More about this action #

The environment argument: Pass development; any other value is refused invalid_request, because production is deleted only with its application. On an application with one environment, the call is refused environment_not_created unless records of development remain. After the deletion the application has one environment, and a deploy goes to production.

Pass request_id to make a repeat safe. While the earlier pending action is still live (requested, approved, or executing), a call with the same request_id from the same account returns that action and creates no second one. Once the action has completed, failed, been declined, or expired, the same request_id starts a new one.

Access and action metadata #

{
  "name": "delete_environment",
  "resource": "environment",
  "tier": "destructive",
  "surface": "tzcloud",
  "addresses": [
    "tzcloud"
  ],
  "product": "cloud",
  "summary": "Delete the development environment and what it holds — container, database, realm, credentials, files, logs, and its version rows withdrawn from `list_versions` — keeping the application and its production environment; production is deleted only with its application. Afterwards a deploy goes to production. On one environment the call is admitted where development's records remain: a database setup, whole or stopped partway, a deletion of them that stopped, or a record an earlier version of the platform left. It then erases them, the secrets, files, and logs kept for local runs among them, and the next submit_manifest sets the database up again. Otherwise it is refused `environment_not_created`.",
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": true,
    "openWorldHint": true
  }
}

MCP catalog entry #

{
  "name": "delete_environment",
  "title": "Delete environment",
  "tier": "destructive",
  "scenario": "CHI-L0-10",
  "summary": "Delete an application's development environment and everything running or stored in it: its container, database, realm, credentials, files, and logs. Its versions are withdrawn from `list_versions`. The call keeps the application, its production environment, its areas, and its declarations. Production is deleted only with its application. Afterwards the application has one environment, so a deploy goes to production. With one environment, the call is accepted only where development's records remain. These are a database setup, whole or stopped partway, a deletion of them that stopped, or a record an earlier version of the platform left. It then erases them, the secrets, files, and logs kept for local runs among them, and the next submit_manifest sets the database up again. Otherwise it is refused `environment_not_created`. Destructive: completes only after a person approves it in the browser.",
  "owners": [
    "PLD-L0-66",
    "PLD-L0-40",
    "MAPI-05"
  ]
}

request #

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

Type: string
/properties/environment development alone; production is refused invalid_request, because production is deleted only with its application through delete_application. On an application with one environment the call is refused environment_not_created.

Type: string
Pattern: ^(development|production)$
/properties/request_id Any string you choose. A repeat from the same account while the earlier pending action is live (requested, approved, or executing) returns it again; once it has ended, it starts a new one. Omitted, every call creates a new one.

Type: string

response #

JSON pointer Description and constraints
"" (root) The 202 creation envelope: the pending action and its approval link. Read the terminal outcome on the pending record with read_approval_status. On a failed walk the outcome holds receipts, one receipt per kind for the members that ran before the failing member, beside execution_failed; a retry of the deletion runs the walk again, and a member already run returns zero removals.

Type: object
Required fields: ["contract_version","pending_action","approval_url"]
/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/pending_action $ref: #/shapes/pending_action
/properties/approval_url Type: string
/properties/detail Type: string

Complete payload contract #

{
  "request": {
    "type": "object",
    "required": [
      "application",
      "environment"
    ],
    "properties": {
      "application": {
        "type": "string",
        "description": "Your account's application `id` from `list_applications`, not its name or label."
      },
      "environment": {
        "type": "string",
        "pattern": "^(development|production)$",
        "description": "`development` alone; `production` is refused `invalid_request`, because production is deleted only with its application through `delete_application`. On an application with one environment the call is refused `environment_not_created`."
      },
      "request_id": {
        "type": "string",
        "description": "Any string you choose. A repeat from the same account while the earlier pending action is live (requested, approved, or executing) returns it again; once it has ended, it starts a new one. Omitted, every call creates a new one."
      }
    }
  },
  "response": {
    "type": "object",
    "description": "The 202 creation envelope: the pending action and its approval link. Read the terminal outcome on the pending record with read_approval_status (API-L0-07). On a failed walk the outcome holds `receipts`, one receipt per kind for the members that ran before the failing member, beside `execution_failed`; a retry of the deletion runs the walk again, and a member already run returns zero removals (PLD-L0-66).",
    "required": [
      "contract_version",
      "pending_action",
      "approval_url"
    ],
    "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."
      },
      "pending_action": {
        "$ref": "#/shapes/pending_action"
      },
      "approval_url": {
        "type": "string"
      },
      "detail": {
        "type": "string"
      }
    }
  }
}

Shared contracts #