{"id":"pageworkers_get_or_create_optimization","name":"Get or create a PageWorkers optimization","alias":"PageWorkersGetOrCreateOptimization","aliases":[],"description_short":"Get an existing or create a new PageWorkers optimization (PAGE_EDITOR module).","description_long":"\n    This agent looks for an existing PageWorkers optimization by name for the given website.\n    If a matching optimization is found, it is returned. Otherwise, a new PAGE_EDITOR optimization\n    is created with the provided configuration (actions, data schema, dataset entries, etc.).\n    The result includes the app URL of the optimization.\n    ","description_tool_prompt":"\n    Get or create a PageWorkers PAGE_EDITOR optimization. Searches existing modules by name and returns\n    the matching one, or creates a new module with the specified configuration.\n    The result includes the app URL of the optimization.\n    ","source":"Botify","conversation_examples":["Create a PageWorkers optimization named 'FAQ Section' that inserts FAQ content after #description","Get or create an optimization to add structured data to product pages"],"tags":["collaboration"],"available_in_chat":false,"available_in_deepthink":false,"available_in_mcp":true,"mcp_audience":"all","config":{"type":"object","properties":{},"required":[]},"item":{"type":"object","properties":{"name":{"description":"Name of the optimization","title":"Name","type":"string"},"description":{"default":"","description":"Description of the optimization","title":"Description","type":"string"},"actions":{"description":"List of actions to apply in the optimization","items":{"$ref":"#/$defs/Action"},"title":"Actions","type":"array"},"data_schema":{"description":"Schema for the main dataset (list of field definitions)","items":{"$ref":"#/$defs/DataSchemaField"},"title":"Data Schema","type":"array"},"entries":{"description":"Initial dataset entries (URLs and their variable values)","items":{"$ref":"#/$defs/DatasetEntry"},"title":"Entries","type":"array"},"split_testing_variant_group_size_percentage":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Split testing variant group size percentage (null for no split testing)","title":"Split Testing Variant Group Size Percentage"}},"required":["name","actions","data_schema","entries"],"$defs":{"Action":{"description":"An action to apply in the optimization.","properties":{"actionType":{"default":"elementInnerHtml","description":"Type of action (e.g. 'elementInnerHtml')","title":"Actiontype","type":"string"},"transformationType":{"default":"template","description":"Type of transformation (e.g. 'template')","title":"Transformationtype","type":"string"},"actionConfig":{"$ref":"#/$defs/ActionConfig","description":"Action target configuration"},"transformationConfig":{"$ref":"#/$defs/TransformationConfig","description":"Transformation configuration"}},"required":["actionConfig","transformationConfig"],"title":"Action","type":"object"},"ActionConfig":{"description":"Configuration for an action's target element.","properties":{"cssSelector":{"description":"CSS selector for the target element","title":"Cssselector","type":"string"},"cssStrategy":{"description":"Strategy for element placement","enum":["insertAfter","insertBefore","append","prepend","replace"],"title":"Cssstrategy","type":"string"}},"required":["cssSelector","cssStrategy"],"title":"ActionConfig","type":"object"},"DataSchemaField":{"description":"A field in the main dataset data schema.","properties":{"identifier":{"description":"Unique identifier for the field","title":"Identifier","type":"string"},"name":{"description":"Display name for the field","title":"Name","type":"string"},"type":{"default":"string","description":"Data type of the field (e.g. 'string')","title":"Type","type":"string"},"required":{"default":false,"description":"Whether the field is required","title":"Required","type":"boolean"}},"required":["identifier","name"],"title":"DataSchemaField","type":"object"},"DatasetEntry":{"additionalProperties":true,"description":"An entry in the dataset (URL + variable values).","properties":{"url":{"description":"URL for this dataset entry","title":"Url","type":"string"}},"required":["url"],"title":"DatasetEntry","type":"object"},"TransformationConfig":{"description":"Configuration for an action's transformation.","properties":{"template":{"description":"HTML template with {{ variable }} placeholders","title":"Template","type":"string"}},"required":["template"],"title":"TransformationConfig","type":"object"}}},"response":{"description":"Output of the PageWorkers get-or-create optimization agent.","properties":{"websiteId":{"description":"The website ID","title":"Websiteid","type":"string"},"module":{"additionalProperties":true,"description":"The PageWorkers module data","title":"Module","type":"object"},"created":{"description":"Whether the module was created (True) or already existed (False)","title":"Created","type":"boolean"},"url":{"description":"App URL of the optimization","title":"Url","type":"string"},"message":{"description":"Message about the operation","title":"Message","type":"string"}},"required":["websiteId","module","created","url","message"],"title":"PageWorkersGetOrCreateProcessedItem","type":"object"},"has_canvas":false,"open_canvas_automatically":false}