Connect an agent

dev/page MCP tool

delete_folder

Delete one empty leaf folder.

When to use it

Only when the user explicitly asks to remove an empty folder.

Behavior

Deletes only an empty leaf folder and never deletes or unfiles pages. Restricted to the workspace owner.

Required scopes
pages:write
Idempotency
not-applicable
Side effects
Permanently deletes one empty leaf folder.
Cost
One guarded folder deletion.
Recovery
Move pages and child folders first, then retry only with explicit user approval.
Stable errors
owner_required, invalid_folder, folder_not_empty, workspace_not_found, workspace_access_revoked, rate_limited, service_not_ready

Exact input schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "folderId": {
      "type": "string",
      "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)$"
    },
    "workspace": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "pattern": "^[a-z0-9]+(?:[_-][a-z0-9]+)*$"
    }
  },
  "required": [
    "folderId"
  ],
  "additionalProperties": false
}

Exact success schema

Every successful MCP response uses this validated { contractVersion, requestId, data } envelope.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "contractVersion": {
      "type": "string",
      "const": "9"
    },
    "data": {
      "type": "object",
      "properties": {
        "folderId": {
          "type": "string",
          "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)$"
        },
        "success": {
          "type": "boolean",
          "const": true
        },
        "workspace": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "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)$"
            },
            "isDefault": {
              "type": "boolean"
            },
            "name": {
              "type": "string"
            },
            "role": {
              "type": "string",
              "enum": [
                "owner",
                "editor"
              ]
            },
            "slug": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80,
              "pattern": "^[a-z0-9]+(?:[_-][a-z0-9]+)*$"
            }
          },
          "required": [
            "id",
            "isDefault",
            "name",
            "role",
            "slug"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "folderId",
        "success",
        "workspace"
      ],
      "additionalProperties": false
    },
    "requestId": {
      "type": "string",
      "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)$"
    }
  },
  "required": [
    "contractVersion",
    "data",
    "requestId"
  ],
  "additionalProperties": false
}

Back to MCP workflows