clear_development_database #

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

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 #

Clear your application's development database: drop every table and row and create it again empty under the same role. It cannot be undone. The development credential and environment-file connection string keep working. Production's database is never cleared. Give a person approval_url to approve in a browser. Read read_approval_status until it ends. Rebuild only on completed. After completion, restart development to re-run the serving version's migrations. Deploy development for edited migration files. On one environment, restart your local run. A development deploy or restart in flight when approved fails the clear as deploy_in_flight, clearing nothing.

More about this action #

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.

environment is required and must be development. Hand the person the returned approval_url and read the outcome with read_approval_status. Read read_approval_status until it ends; only on completed, restart development to re-run the serving version's migrations. Deploy development for edited migration files. On one environment, restart the local run instead. A failed or declined clear is not a completed clear. No snapshot is taken and nothing restores the cleared data. A development deploy or restart in flight at approval fails the clear with deploy_in_flight, clearing nothing.

Access and action metadata #

{
  "name": "clear_development_database",
  "resource": "environment",
  "tier": "destructive",
  "surface": "tzcloud",
  "addresses": [
    "tzcloud"
  ],
  "product": "cloud",
  "summary": "Clear the development database: drop it with every table and row in it, and create it again empty under the same role. The development credential and the environment file's connection string stay valid. `restart_application` on development, or a deploy, then runs the application's migrations, which rebuild the tables. Production's database is never cleared.",
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": true,
    "openWorldHint": false
  }
}

MCP catalog entry #

{
  "name": "clear_development_database",
  "title": "Clear development database",
  "tier": "destructive",
  "scenario": "CHI-L0-10",
  "summary": "Clear your application's development database: drop every table and row and create it again empty under the same role. It cannot be undone. The development credential and environment-file connection string keep working. Production's database is never cleared. Give a person `approval_url` to approve in a browser. Read `read_approval_status` until it ends. Rebuild only on completed. After completion, restart development to re-run the serving version's migrations. Deploy development for edited migration files. On one environment, restart your local run. A development deploy or restart in flight when approved fails the clear as `deploy_in_flight`, clearing nothing.",
  "owners": [
    "DBS-L0-10",
    "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 no action clears production's database.

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. A completed clear's outcome carries cleared: true, the application, the environment, the database name, its role, and a detail giving the acts that rebuild the tables: a development restart_application or deploy where the application has development, and a new local run. An application with no development database is refused 404 not_found at the request. A development deploy or restart (a restart_application) in flight when the approved clear runs fails it with deploy_in_flight, and nothing is cleared.

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 no action clears production's database."
      },
      "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). A completed clear's outcome carries `cleared: true`, the `application`, the `environment`, the `database` name, its `role`, and a `detail` giving the acts that rebuild the tables: a development `restart_application` or deploy where the application has development, and a new local run (DBS-L0-10). An application with no development database is refused 404 `not_found` at the request. A development deploy or restart (a `restart_application`) in flight when the approved clear runs fails it with `deploy_in_flight`, and nothing is cleared.",
    "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 #