Agentic Platform
Documentation API reference Tools Skills

Tools

Get or create a PageWorkers optimization

pageworkers_get_or_create_optimization MCP Collaboration

Get an existing or create a new PageWorkers optimization (PAGE_EDITOR module).

This agent looks for an existing PageWorkers optimization by name for the given website. If a matching optimization is found, it is returned. Otherwise, a new PAGE_EDITOR optimization is created with the provided configuration (actions, data schema, dataset entries, etc.). The result includes the app URL of the optimization.

Playground

POST
item
name required

Name of the optimization

description

Description of the optimization

actions required

List of actions to apply in the optimization

data_schema required

Schema for the main dataset (list of field definitions)

entries required

Initial dataset entries (URLs and their variable values)

split_testing_variant_group_size_percentage

Split testing variant group size percentage (null for no split testing)

Credits

Fixed cost per item requested. This tool reads data Botify already holds for your project and calls no outside service, so nothing is added to the per-call price.

These usage SKUs can be charged on a call.

SKU Credits Description
Tool call 1 per request Charged once per successful item.

Schemas

item is what you send, config how the tool behaves, and the response is what you get back.

Item

object
Properties
name string required

Name of the optimization

description string

Description of the optimization

Default: ""

actions array required

List of actions to apply in the optimization

Items: Action

data_schema array required

Schema for the main dataset (list of field definitions)

Items: DataSchemaField

entries array required

Initial dataset entries (URLs and their variable values)

Items: DatasetEntry

split_testing_variant_group_size_percentage integer | null

Split testing variant group size percentage (null for no split testing)

Default: null

Example
{
  "name": "string",
  "description": "",
  "actions": [
    {
      "actionType": "elementInnerHtml",
      "transformationType": "template",
      "actionConfig": {
        "cssSelector": "string",
        "cssStrategy": "insertAfter"
      },
      "transformationConfig": {
        "template": "string"
      }
    }
  ],
  "data_schema": [
    {
      "identifier": "string",
      "name": "string",
      "type": "string",
      "required": false
    }
  ],
  "entries": [
    {
      "url": "string"
    }
  ],
  "split_testing_variant_group_size_percentage": null
}

Type Definitions

5 types

These are the available sub-object types that can be used in the properties above.

Action object
#

An action to apply in the optimization.

actionType string

Type of action (e.g. 'elementInnerHtml')

Default: "elementInnerHtml"

transformationType string

Type of transformation (e.g. 'template')

Default: "template"

actionConfig ActionConfig required

Action target configuration

Type: ActionConfig

transformationConfig TransformationConfig required

Transformation configuration

Type: TransformationConfig

ActionConfig object
#

Configuration for an action's target element.

cssSelector string required

CSS selector for the target element

cssStrategy string required

Strategy for element placement

Values: insertAfter insertBefore append prepend replace

DataSchemaField object
#

A field in the main dataset data schema.

identifier string required

Unique identifier for the field

name string required

Display name for the field

type string

Data type of the field (e.g. 'string')

Default: "string"

required boolean

Whether the field is required

Default: false

DatasetEntry object
#

An entry in the dataset (URL + variable values).

url string required

URL for this dataset entry

TransformationConfig object
#

Configuration for an action's transformation.

template string required

HTML template with {{ variable }} placeholders

Response

object

Output of the PageWorkers get-or-create optimization agent.

Properties
websiteId string required

The website ID

module object required

The PageWorkers module data

created boolean required

Whether the module was created (True) or already existed (False)

url string required

App URL of the optimization

message string required

Message about the operation

Example
{
  "websiteId": "string",
  "module": {},
  "created": true,
  "url": "string",
  "message": "string"
}

Endpoints

POST http://agents.botify.com/{organization}/{project}/pageworkers_get_or_create_optimization/process
POST http://agents.botify.com/{organization}/{project}/pageworkers_get_or_create_optimization/batch_process
POST http://agents.botify.com/{organization}/{project}/pageworkers_get_or_create_optimization/async_process
POST http://agents.botify.com/{organization}/{project}/pageworkers_get_or_create_optimization/async_batch_process

See running a long job in the background for the polling flow.

cURL

curl -X POST "http://agents.botify.com/{organization}/{project}/pageworkers_get_or_create_optimization/process" \
  -H "Authorization: Bearer $BOTIFY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "item": {
    "name": "<name>",
    "actions": [],
    "data_schema": [],
    "entries": []
  }
}'

Over MCP

This tool is exposed as the MCP tool pageworkers_get_or_create_optimization. An MCP client passes organization, project and item as tool arguments. Set up MCP →

Raw metadata