diff --git a/inc/Api/Chat/Tools/AddPipelineStep.php b/inc/Api/Chat/Tools/AddPipelineStep.php index 667622678..91444e352 100644 --- a/inc/Api/Chat/Tools/AddPipelineStep.php +++ b/inc/Api/Chat/Tools/AddPipelineStep.php @@ -43,16 +43,18 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Add a step to a pipeline. Automatically syncs to all flows on that pipeline.', 'parameters' => array( - 'pipeline_id' => array( - 'type' => 'integer', - 'required' => true, - 'description' => 'Pipeline ID to add the step to', - ), - 'step_type' => array( - 'type' => 'string', - 'required' => true, - 'description' => "Type of step: {$types_list}", + 'type' => 'object', + 'properties' => array( + 'pipeline_id' => array( + 'type' => 'integer', + 'description' => 'Pipeline ID to add the step to', + ), + 'step_type' => array( + 'type' => 'string', + 'description' => "Type of step: {$types_list}", + ), ), + 'required' => array( 'pipeline_id', 'step_type' ), ), ); } diff --git a/inc/Api/Chat/Tools/ApiQuery.php b/inc/Api/Chat/Tools/ApiQuery.php index d2b420dc9..e39196819 100644 --- a/inc/Api/Chat/Tools/ApiQuery.php +++ b/inc/Api/Chat/Tools/ApiQuery.php @@ -39,15 +39,17 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => $this->buildApiDocumentation(), 'parameters' => array( - 'endpoint' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Single mode: REST API endpoint path (e.g., /datamachine/v1/handlers)', - ), - 'requests' => array( - 'type' => 'array', - 'required' => false, - 'description' => 'Batch mode: Array of {endpoint, key?}. Results keyed by endpoint or custom key.', + 'type' => 'object', + 'properties' => array( + 'endpoint' => array( + 'type' => 'string', + 'description' => 'Single mode: REST API endpoint path (e.g., /datamachine/v1/handlers)', + ), + 'requests' => array( + 'type' => 'array', + 'items' => array( 'type' => 'object' ), + 'description' => 'Batch mode: Array of {endpoint, key?}. Results keyed by endpoint or custom key.', + ), ), ), ); diff --git a/inc/Api/Chat/Tools/AssignTaxonomyTerm.php b/inc/Api/Chat/Tools/AssignTaxonomyTerm.php index 6d9c395f5..47b6fb5a2 100644 --- a/inc/Api/Chat/Tools/AssignTaxonomyTerm.php +++ b/inc/Api/Chat/Tools/AssignTaxonomyTerm.php @@ -30,26 +30,27 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Assign a taxonomy term to one or more posts. Can append to existing terms or replace them.', 'parameters' => array( - 'term' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'Term to assign - ID, name, or slug', - ), - 'taxonomy' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'Taxonomy slug (venue, artist, category, post_tag, etc.)', - ), - 'post_ids' => array( - 'type' => 'array', - 'required' => true, - 'description' => 'Array of post IDs to assign the term to', - ), - 'append' => array( - 'type' => 'boolean', - 'required' => false, - 'description' => 'true = add to existing terms, false = replace existing terms (default: true)', + 'type' => 'object', + 'properties' => array( + 'term' => array( + 'type' => 'string', + 'description' => 'Term to assign - ID, name, or slug', + ), + 'taxonomy' => array( + 'type' => 'string', + 'description' => 'Taxonomy slug (venue, artist, category, post_tag, etc.)', + ), + 'post_ids' => array( + 'type' => 'array', + 'items' => array( 'type' => 'integer' ), + 'description' => 'Array of post IDs to assign the term to', + ), + 'append' => array( + 'type' => 'boolean', + 'description' => 'true = add to existing terms, false = replace existing terms (default: true)', + ), ), + 'required' => array( 'term', 'taxonomy', 'post_ids' ), ), ); } diff --git a/inc/Api/Chat/Tools/AuthenticateHandler.php b/inc/Api/Chat/Tools/AuthenticateHandler.php index adbfe361c..8177095b9 100644 --- a/inc/Api/Chat/Tools/AuthenticateHandler.php +++ b/inc/Api/Chat/Tools/AuthenticateHandler.php @@ -38,22 +38,23 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => $this->buildDescription(), 'parameters' => array( - 'action' => array( - 'type' => 'string', - 'required' => true, - 'enum' => array( 'list', 'status', 'configure', 'get_oauth_url', 'disconnect' ), - 'description' => 'Action to perform: list (all statuses), status (specific handler), configure (save credentials), get_oauth_url (for OAuth), disconnect (clear auth)', - ), - 'handler_slug' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Handler identifier (required for all actions except list)', - ), - 'credentials' => array( - 'type' => 'object', - 'required' => false, - 'description' => 'Credentials object for configure action. For OAuth: {client_id, client_secret}. For simple auth: handler-specific fields.', + 'type' => 'object', + 'properties' => array( + 'action' => array( + 'type' => 'string', + 'enum' => array( 'list', 'status', 'configure', 'get_oauth_url', 'disconnect' ), + 'description' => 'Action to perform: list (all statuses), status (specific handler), configure (save credentials), get_oauth_url (for OAuth), disconnect (clear auth)', + ), + 'handler_slug' => array( + 'type' => 'string', + 'description' => 'Handler identifier (required for all actions except list)', + ), + 'credentials' => array( + 'type' => 'object', + 'description' => 'Credentials object for configure action. For OAuth: {client_id, client_secret}. For simple auth: handler-specific fields.', + ), ), + 'required' => array( 'action' ), ), ); } diff --git a/inc/Api/Chat/Tools/ConfigureFlowSteps.php b/inc/Api/Chat/Tools/ConfigureFlowSteps.php index 817ecf983..622febe78 100644 --- a/inc/Api/Chat/Tools/ConfigureFlowSteps.php +++ b/inc/Api/Chat/Tools/ConfigureFlowSteps.php @@ -56,75 +56,67 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => $description, 'parameters' => array( - 'flow_step_id' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Single flow step ID (format: {pipeline_step_id}_{flow_id})', - ), - 'flow_step_ids' => array( - 'type' => 'array', - 'required' => false, - 'description' => 'Array of flow step IDs for batch updates on specific steps', - ), - 'pipeline_id' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Pipeline scope. REQUIRES either handler_slug (filter) or all_flows=true', - ), - 'all_flows' => array( - 'type' => 'boolean', - 'required' => false, - 'description' => 'When true with pipeline_id, applies to ALL flows in pipeline. Explicit opt-in required for bulk operations.', - ), - 'step_type' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Filter by step type (fetch, publish, upsert, ai)', - ), - 'handler_slug' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Handler slug to set (single mode) OR filter by existing handler (bulk mode). Works with or without pipeline_id scope.', - ), - 'target_handler_slug' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Handler to switch TO. When provided, handler_slug filters existing handlers (bulk) and target_handler_slug sets the new handler.', - ), - 'field_map' => array( - 'type' => 'object', - 'required' => false, - 'description' => 'Field mappings when switching handlers, e.g. {"endpoint_url": "source_url"}. Fields with matching names auto-map by default.', - ), - 'handler_config' => array( - 'type' => 'object', - 'required' => false, - 'description' => 'Handler-specific configuration to merge into existing config', - ), - 'flow_configs' => array( - 'type' => 'array', - 'required' => false, - 'description' => 'Per-flow configurations for bulk mode. Array of {flow_id: int, handler_config: object}. Merged with shared handler_config (per-flow takes precedence).', - ), - 'user_message' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'User message/prompt for AI steps', - ), - 'updates' => array( - 'type' => 'array', - 'required' => false, - 'description' => 'Cross-pipeline mode: configure multiple flows with different settings. Each item: {flow_id, step_configs (keyed by step_type: {handler_slug?, handler_config?, user_message?})}', - ), - 'shared_config' => array( - 'type' => 'object', - 'required' => false, - 'description' => 'Shared step config for cross-pipeline mode (keyed by step_type). Per-flow step_configs override these.', - ), - 'validate_only' => array( - 'type' => 'boolean', - 'required' => false, - 'description' => 'Dry-run mode: validate configuration without executing. Returns what would be updated.', + 'type' => 'object', + 'properties' => array( + 'flow_step_id' => array( + 'type' => 'string', + 'description' => 'Single flow step ID (format: {pipeline_step_id}_{flow_id})', + ), + 'flow_step_ids' => array( + 'type' => 'array', + 'items' => array( 'type' => 'string' ), + 'description' => 'Array of flow step IDs for batch updates on specific steps', + ), + 'pipeline_id' => array( + 'type' => 'integer', + 'description' => 'Pipeline scope. REQUIRES either handler_slug (filter) or all_flows=true', + ), + 'all_flows' => array( + 'type' => 'boolean', + 'description' => 'When true with pipeline_id, applies to ALL flows in pipeline. Explicit opt-in required for bulk operations.', + ), + 'step_type' => array( + 'type' => 'string', + 'description' => 'Filter by step type (fetch, publish, upsert, ai)', + ), + 'handler_slug' => array( + 'type' => 'string', + 'description' => 'Handler slug to set (single mode) OR filter by existing handler (bulk mode). Works with or without pipeline_id scope.', + ), + 'target_handler_slug' => array( + 'type' => 'string', + 'description' => 'Handler to switch TO. When provided, handler_slug filters existing handlers (bulk) and target_handler_slug sets the new handler.', + ), + 'field_map' => array( + 'type' => 'object', + 'description' => 'Field mappings when switching handlers, e.g. {"endpoint_url": "source_url"}. Fields with matching names auto-map by default.', + ), + 'handler_config' => array( + 'type' => 'object', + 'description' => 'Handler-specific configuration to merge into existing config', + ), + 'flow_configs' => array( + 'type' => 'array', + 'items' => array( 'type' => 'object' ), + 'description' => 'Per-flow configurations for bulk mode. Array of {flow_id: int, handler_config: object}. Merged with shared handler_config (per-flow takes precedence).', + ), + 'user_message' => array( + 'type' => 'string', + 'description' => 'User message/prompt for AI steps', + ), + 'updates' => array( + 'type' => 'array', + 'items' => array( 'type' => 'object' ), + 'description' => 'Cross-pipeline mode: configure multiple flows with different settings. Each item: {flow_id, step_configs (keyed by step_type: {handler_slug?, handler_config?, user_message?})}', + ), + 'shared_config' => array( + 'type' => 'object', + 'description' => 'Shared step config for cross-pipeline mode (keyed by step_type). Per-flow step_configs override these.', + ), + 'validate_only' => array( + 'type' => 'boolean', + 'description' => 'Dry-run mode: validate configuration without executing. Returns what would be updated.', + ), ), ), ); diff --git a/inc/Api/Chat/Tools/ConfigurePipelineStep.php b/inc/Api/Chat/Tools/ConfigurePipelineStep.php index d8d190807..18c7689f6 100644 --- a/inc/Api/Chat/Tools/ConfigurePipelineStep.php +++ b/inc/Api/Chat/Tools/ConfigurePipelineStep.php @@ -35,26 +35,28 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Configure pipeline-level AI step settings: system prompt and tool policy. Model/provider are managed via the mode_models site setting, not per-pipeline. For flow-level settings (handler, handler_config, user_message), use configure_flow_steps instead.', 'parameters' => array( - 'pipeline_step_id' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'Pipeline step ID to configure (e.g., "123_uuid4")', - ), - 'system_prompt' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'System prompt for the AI step - defines the AI persona and instructions', - ), - 'disabled_tools' => array( - 'type' => 'array', - 'required' => false, - 'description' => 'Array of tool slugs to disable for this AI step', - ), - 'tool_categories' => array( - 'type' => 'array', - 'required' => false, - 'description' => 'Array of ability categories allowed for this AI step', + 'type' => 'object', + 'properties' => array( + 'pipeline_step_id' => array( + 'type' => 'string', + 'description' => 'Pipeline step ID to configure (e.g., "123_uuid4")', + ), + 'system_prompt' => array( + 'type' => 'string', + 'description' => 'System prompt for the AI step - defines the AI persona and instructions', + ), + 'disabled_tools' => array( + 'type' => 'array', + 'items' => array( 'type' => 'string' ), + 'description' => 'Array of tool slugs to disable for this AI step', + ), + 'tool_categories' => array( + 'type' => 'array', + 'items' => array( 'type' => 'string' ), + 'description' => 'Array of ability categories allowed for this AI step', + ), ), + 'required' => array( 'pipeline_step_id' ), ), ); } diff --git a/inc/Api/Chat/Tools/CopyFlow.php b/inc/Api/Chat/Tools/CopyFlow.php index 4fd99e457..07283799f 100644 --- a/inc/Api/Chat/Tools/CopyFlow.php +++ b/inc/Api/Chat/Tools/CopyFlow.php @@ -36,31 +36,30 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Copy a flow to the same or different pipeline. Cross-pipeline requires compatible step structures. Copies handlers, messages, and schedule.', 'parameters' => array( - 'source_flow_id' => array( - 'type' => 'integer', - 'required' => true, - 'description' => 'Flow ID to copy', - ), - 'target_pipeline_id' => array( - 'type' => 'integer', - 'required' => true, - 'description' => 'Destination pipeline ID', - ), - 'flow_name' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'New flow name', - ), - 'scheduling_config' => array( - 'type' => 'object', - 'required' => false, - 'description' => 'Override schedule (defaults to source). Format: {interval: value}. Valid intervals:' . "\n" . SchedulingDocumentation::getIntervalsJson(), - ), - 'step_config_overrides' => array( - 'type' => 'object', - 'required' => false, - 'description' => 'Override steps by step_type or execution_order: {handler_slug?, handler_config?, user_message?}', + 'type' => 'object', + 'properties' => array( + 'source_flow_id' => array( + 'type' => 'integer', + 'description' => 'Flow ID to copy', + ), + 'target_pipeline_id' => array( + 'type' => 'integer', + 'description' => 'Destination pipeline ID', + ), + 'flow_name' => array( + 'type' => 'string', + 'description' => 'New flow name', + ), + 'scheduling_config' => array( + 'type' => 'object', + 'description' => 'Override schedule (defaults to source). Format: {interval: value}. Valid intervals:' . "\n" . SchedulingDocumentation::getIntervalsJson(), + ), + 'step_config_overrides' => array( + 'type' => 'object', + 'description' => 'Override steps by step_type or execution_order: {handler_slug?, handler_config?, user_message?}', + ), ), + 'required' => array( 'source_flow_id', 'target_pipeline_id', 'flow_name' ), ), ); } diff --git a/inc/Api/Chat/Tools/CreateFlow.php b/inc/Api/Chat/Tools/CreateFlow.php index d530094c2..5fc5b1666 100644 --- a/inc/Api/Chat/Tools/CreateFlow.php +++ b/inc/Api/Chat/Tools/CreateFlow.php @@ -36,40 +36,37 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Create a new flow for a pipeline with optional step configurations. Query existing flows first to learn established patterns. Supports bulk mode via flows array.', 'parameters' => array( - 'pipeline_id' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Pipeline ID (single mode - required unless using bulk mode)', - ), - 'flow_name' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Flow name (defaults to "Flow")', - ), - 'scheduling_config' => array( - 'type' => 'object', - 'required' => false, - 'description' => 'Schedule: {interval: value}. Valid intervals:' . "\n" . SchedulingDocumentation::getIntervalsJson(), - ), - 'step_configs' => array( - 'type' => 'object', - 'required' => false, - 'description' => 'Step configurations keyed by step_type: {handler_slug?, handler_config?, user_message?}', - ), - 'flows' => array( - 'type' => 'array', - 'required' => false, - 'description' => 'Bulk mode: create multiple flows. Each item: {pipeline_id, flow_name, step_configs?, scheduling_config?}. Uses shared_step_config as base.', - ), - 'shared_step_config' => array( - 'type' => 'object', - 'required' => false, - 'description' => 'Shared step config for bulk mode (keyed by step_type). Per-flow step_configs override these.', - ), - 'validate_only' => array( - 'type' => 'boolean', - 'required' => false, - 'description' => 'Dry-run mode: validate configuration without creating. Returns what would be created.', + 'type' => 'object', + 'properties' => array( + 'pipeline_id' => array( + 'type' => 'integer', + 'description' => 'Pipeline ID (single mode - required unless using bulk mode)', + ), + 'flow_name' => array( + 'type' => 'string', + 'description' => 'Flow name (defaults to "Flow")', + ), + 'scheduling_config' => array( + 'type' => 'object', + 'description' => 'Schedule: {interval: value}. Valid intervals:' . "\n" . SchedulingDocumentation::getIntervalsJson(), + ), + 'step_configs' => array( + 'type' => 'object', + 'description' => 'Step configurations keyed by step_type: {handler_slug?, handler_config?, user_message?}', + ), + 'flows' => array( + 'type' => 'array', + 'items' => array( 'type' => 'object' ), + 'description' => 'Bulk mode: create multiple flows. Each item: {pipeline_id, flow_name, step_configs?, scheduling_config?}. Uses shared_step_config as base.', + ), + 'shared_step_config' => array( + 'type' => 'object', + 'description' => 'Shared step config for bulk mode (keyed by step_type). Per-flow step_configs override these.', + ), + 'validate_only' => array( + 'type' => 'boolean', + 'description' => 'Dry-run mode: validate configuration without creating. Returns what would be created.', + ), ), ), ); diff --git a/inc/Api/Chat/Tools/CreatePipeline.php b/inc/Api/Chat/Tools/CreatePipeline.php index 39e604606..91fe56cb4 100644 --- a/inc/Api/Chat/Tools/CreatePipeline.php +++ b/inc/Api/Chat/Tools/CreatePipeline.php @@ -43,40 +43,38 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Create a pipeline with optional steps. Automatically creates a flow - do NOT call create_flow afterward. Supports bulk mode via pipelines array.', 'parameters' => array( - 'pipeline_name' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Pipeline name (single mode - required unless using bulk mode)', - ), - 'steps' => array( - 'type' => 'array', - 'required' => false, - 'description' => "Steps in execution order: {step_type: \"{$types_list}\", handler_slug, handler_config}. AI steps: add provider, model, system_prompt.", - ), - 'flow_name' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Flow name (defaults to pipeline_name)', - ), - 'scheduling_config' => array( - 'type' => 'object', - 'required' => false, - 'description' => 'Schedule: {interval: value}. Valid intervals:' . "\n" . SchedulingDocumentation::getIntervalsJson(), - ), - 'pipelines' => array( - 'type' => 'array', - 'required' => false, - 'description' => 'Bulk mode: create multiple pipelines. Each item: {name, steps?, flow_name?, scheduling_config?}. Uses template for shared config.', - ), - 'template' => array( - 'type' => 'object', - 'required' => false, - 'description' => 'Shared config for bulk mode: {steps, scheduling_config}. Individual pipeline configs override template.', - ), - 'validate_only' => array( - 'type' => 'boolean', - 'required' => false, - 'description' => 'Dry-run mode: validate configuration without creating. Returns what would be created.', + 'type' => 'object', + 'properties' => array( + 'pipeline_name' => array( + 'type' => 'string', + 'description' => 'Pipeline name (single mode - required unless using bulk mode)', + ), + 'steps' => array( + 'type' => 'array', + 'items' => array( 'type' => 'object' ), + 'description' => "Steps in execution order: {step_type: \"{$types_list}\", handler_slug, handler_config}. AI steps: add provider, model, system_prompt.", + ), + 'flow_name' => array( + 'type' => 'string', + 'description' => 'Flow name (defaults to pipeline_name)', + ), + 'scheduling_config' => array( + 'type' => 'object', + 'description' => 'Schedule: {interval: value}. Valid intervals:' . "\n" . SchedulingDocumentation::getIntervalsJson(), + ), + 'pipelines' => array( + 'type' => 'array', + 'items' => array( 'type' => 'object' ), + 'description' => 'Bulk mode: create multiple pipelines. Each item: {name, steps?, flow_name?, scheduling_config?}. Uses template for shared config.', + ), + 'template' => array( + 'type' => 'object', + 'description' => 'Shared config for bulk mode: {steps, scheduling_config}. Individual pipeline configs override template.', + ), + 'validate_only' => array( + 'type' => 'boolean', + 'description' => 'Dry-run mode: validate configuration without creating. Returns what would be created.', + ), ), ), ); diff --git a/inc/Api/Chat/Tools/CreateTaxonomyTerm.php b/inc/Api/Chat/Tools/CreateTaxonomyTerm.php index 1fd709537..788ef4fa7 100644 --- a/inc/Api/Chat/Tools/CreateTaxonomyTerm.php +++ b/inc/Api/Chat/Tools/CreateTaxonomyTerm.php @@ -30,26 +30,26 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Create a taxonomy term if it does not exist. Use when configuring flows that need categories, tags, or custom taxonomy terms that are not yet on the site.', 'parameters' => array( - 'taxonomy' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'Taxonomy slug (category, post_tag, or custom taxonomy slug)', - ), - 'name' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'Term name to create', - ), - 'parent' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Parent term name, slug, or ID (hierarchical taxonomies only)', - ), - 'description' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Term description', + 'type' => 'object', + 'properties' => array( + 'taxonomy' => array( + 'type' => 'string', + 'description' => 'Taxonomy slug (category, post_tag, or custom taxonomy slug)', + ), + 'name' => array( + 'type' => 'string', + 'description' => 'Term name to create', + ), + 'parent' => array( + 'type' => 'string', + 'description' => 'Parent term name, slug, or ID (hierarchical taxonomies only)', + ), + 'description' => array( + 'type' => 'string', + 'description' => 'Term description', + ), ), + 'required' => array( 'taxonomy', 'name' ), ), ); } diff --git a/inc/Api/Chat/Tools/DeleteFile.php b/inc/Api/Chat/Tools/DeleteFile.php index 5260f6afe..2b98218fd 100644 --- a/inc/Api/Chat/Tools/DeleteFile.php +++ b/inc/Api/Chat/Tools/DeleteFile.php @@ -33,16 +33,18 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Delete an uploaded file. Requires flow_step_id to identify the file scope.', 'parameters' => array( - 'filename' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'Name of the file to delete', - ), - 'flow_step_id' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Flow step ID for flow-level files (e.g., "1-2" for pipeline 1, flow 2)', + 'type' => 'object', + 'properties' => array( + 'filename' => array( + 'type' => 'string', + 'description' => 'Name of the file to delete', + ), + 'flow_step_id' => array( + 'type' => 'string', + 'description' => 'Flow step ID for flow-level files (e.g., "1-2" for pipeline 1, flow 2)', + ), ), + 'required' => array( 'filename' ), ), ); } diff --git a/inc/Api/Chat/Tools/DeleteFlow.php b/inc/Api/Chat/Tools/DeleteFlow.php index 48b7a0075..e2da9ce05 100644 --- a/inc/Api/Chat/Tools/DeleteFlow.php +++ b/inc/Api/Chat/Tools/DeleteFlow.php @@ -32,11 +32,14 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Delete a flow.', 'parameters' => array( - 'flow_id' => array( - 'type' => 'integer', - 'required' => true, - 'description' => 'ID of the flow to delete', + 'type' => 'object', + 'properties' => array( + 'flow_id' => array( + 'type' => 'integer', + 'description' => 'ID of the flow to delete', + ), ), + 'required' => array( 'flow_id' ), ), ); } diff --git a/inc/Api/Chat/Tools/DeletePipeline.php b/inc/Api/Chat/Tools/DeletePipeline.php index 056624170..bdde1ed45 100644 --- a/inc/Api/Chat/Tools/DeletePipeline.php +++ b/inc/Api/Chat/Tools/DeletePipeline.php @@ -33,11 +33,14 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Delete a pipeline and all its associated flows.', 'parameters' => array( - 'pipeline_id' => array( - 'type' => 'integer', - 'required' => true, - 'description' => 'ID of the pipeline to delete', + 'type' => 'object', + 'properties' => array( + 'pipeline_id' => array( + 'type' => 'integer', + 'description' => 'ID of the pipeline to delete', + ), ), + 'required' => array( 'pipeline_id' ), ), ); } diff --git a/inc/Api/Chat/Tools/DeletePipelineStep.php b/inc/Api/Chat/Tools/DeletePipelineStep.php index f614b0d59..2202f539e 100644 --- a/inc/Api/Chat/Tools/DeletePipelineStep.php +++ b/inc/Api/Chat/Tools/DeletePipelineStep.php @@ -33,16 +33,18 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Remove a step from a pipeline. This removes the step from all flows on the pipeline.', 'parameters' => array( - 'pipeline_id' => array( - 'type' => 'integer', - 'required' => true, - 'description' => 'ID of the pipeline containing the step', - ), - 'pipeline_step_id' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'ID of the pipeline step to remove', + 'type' => 'object', + 'properties' => array( + 'pipeline_id' => array( + 'type' => 'integer', + 'description' => 'ID of the pipeline containing the step', + ), + 'pipeline_step_id' => array( + 'type' => 'string', + 'description' => 'ID of the pipeline step to remove', + ), ), + 'required' => array( 'pipeline_id', 'pipeline_step_id' ), ), ); } diff --git a/inc/Api/Chat/Tools/ExecuteWorkflowTool.php b/inc/Api/Chat/Tools/ExecuteWorkflowTool.php index eb12667e9..8f4ac25c3 100644 --- a/inc/Api/Chat/Tools/ExecuteWorkflowTool.php +++ b/inc/Api/Chat/Tools/ExecuteWorkflowTool.php @@ -60,16 +60,19 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => $description, 'parameters' => array( - 'steps' => array( - 'type' => 'array', - 'required' => true, - 'description' => 'Step objects: {type, handler_slug, handler_config}. AI steps: {type: "ai", user_message}.', - ), - 'dry_run' => array( - 'type' => 'boolean', - 'required' => false, - 'description' => 'Preview execution without creating posts. Returns what would be published instead of actually publishing.', + 'type' => 'object', + 'properties' => array( + 'steps' => array( + 'type' => 'array', + 'items' => array( 'type' => 'object' ), + 'description' => 'Step objects: {type, handler_slug, handler_config}. AI steps: {type: "ai", user_message}.', + ), + 'dry_run' => array( + 'type' => 'boolean', + 'description' => 'Preview execution without creating posts. Returns what would be published instead of actually publishing.', + ), ), + 'required' => array( 'steps' ), ), ); } diff --git a/inc/Api/Chat/Tools/GetHandlerDefaults.php b/inc/Api/Chat/Tools/GetHandlerDefaults.php index d0adf6818..6bc083e76 100644 --- a/inc/Api/Chat/Tools/GetHandlerDefaults.php +++ b/inc/Api/Chat/Tools/GetHandlerDefaults.php @@ -28,10 +28,12 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Get site-wide handler defaults. Use before configuring flows to learn the established configuration standards for this site. Returns defaults for a specific handler or all handlers.', 'parameters' => array( - 'handler_slug' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Handler slug to get defaults for (e.g., upsert_event, eventbrite). If omitted, returns defaults for all handlers.', + 'type' => 'object', + 'properties' => array( + 'handler_slug' => array( + 'type' => 'string', + 'description' => 'Handler slug to get defaults for (e.g., upsert_event, eventbrite). If omitted, returns defaults for all handlers.', + ), ), ), ); diff --git a/inc/Api/Chat/Tools/GetProblemFlows.php b/inc/Api/Chat/Tools/GetProblemFlows.php index 4795340ab..5e99a85c4 100644 --- a/inc/Api/Chat/Tools/GetProblemFlows.php +++ b/inc/Api/Chat/Tools/GetProblemFlows.php @@ -40,10 +40,12 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => "Identify flows with issues: consecutive failures (broken) or consecutive no-items runs (source exhausted). Default threshold: {$default_threshold}.", 'parameters' => array( - 'threshold' => array( - 'type' => 'integer', - 'required' => false, - 'description' => "Minimum consecutive count to report (default: {$default_threshold} from settings)", + 'type' => 'object', + 'properties' => array( + 'threshold' => array( + 'type' => 'integer', + 'description' => "Minimum consecutive count to report (default: {$default_threshold} from settings)", + ), ), ), ); diff --git a/inc/Api/Chat/Tools/ListFlows.php b/inc/Api/Chat/Tools/ListFlows.php index d0b6d00f5..96a5c382d 100644 --- a/inc/Api/Chat/Tools/ListFlows.php +++ b/inc/Api/Chat/Tools/ListFlows.php @@ -26,25 +26,24 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'List flows with optional filtering by pipeline ID or handler slug. Supports pagination.', 'parameters' => array( - 'pipeline_id' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Filter flows by pipeline ID', - ), - 'handler_slug' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Filter flows using this handler slug (any step that uses this handler)', - ), - 'per_page' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Number of flows per page (default: 20, max: 100)', - ), - 'offset' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Offset for pagination (default: 0)', + 'type' => 'object', + 'properties' => array( + 'pipeline_id' => array( + 'type' => 'integer', + 'description' => 'Filter flows by pipeline ID', + ), + 'handler_slug' => array( + 'type' => 'string', + 'description' => 'Filter flows using this handler slug (any step that uses this handler)', + ), + 'per_page' => array( + 'type' => 'integer', + 'description' => 'Number of flows per page (default: 20, max: 100)', + ), + 'offset' => array( + 'type' => 'integer', + 'description' => 'Offset for pagination (default: 0)', + ), ), ), ); diff --git a/inc/Api/Chat/Tools/ManageJobs.php b/inc/Api/Chat/Tools/ManageJobs.php index 30377ba1d..2b7476cfa 100644 --- a/inc/Api/Chat/Tools/ManageJobs.php +++ b/inc/Api/Chat/Tools/ManageJobs.php @@ -34,51 +34,46 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => $this->buildDescription(), 'parameters' => array( - 'action' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'Action to perform: "list", "summary", "delete", "fail", "retry", or "recover"', - ), - 'flow_id' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Filter jobs by flow ID (for list action)', - ), - 'pipeline_id' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Filter jobs by pipeline ID (for list action)', - ), - 'status' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Filter jobs by status: pending, processing, completed, failed, completed_no_items, agent_skipped (for list action)', - ), - 'limit' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Number of jobs to return (for list action, default 50, max 100)', - ), - 'offset' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Offset for pagination (for list action)', - ), - 'type' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'For delete action: "all" or "failed". Required for delete.', - ), - 'job_id' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Job ID (for fail and retry actions)', - ), - 'reason' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Reason for failure (for fail action)', + 'type' => 'object', + 'properties' => array( + 'action' => array( + 'type' => 'string', + 'description' => 'Action to perform: "list", "summary", "delete", "fail", "retry", or "recover"', + ), + 'flow_id' => array( + 'type' => 'integer', + 'description' => 'Filter jobs by flow ID (for list action)', + ), + 'pipeline_id' => array( + 'type' => 'integer', + 'description' => 'Filter jobs by pipeline ID (for list action)', + ), + 'status' => array( + 'type' => 'string', + 'description' => 'Filter jobs by status: pending, processing, completed, failed, completed_no_items, agent_skipped (for list action)', + ), + 'limit' => array( + 'type' => 'integer', + 'description' => 'Number of jobs to return (for list action, default 50, max 100)', + ), + 'offset' => array( + 'type' => 'integer', + 'description' => 'Offset for pagination (for list action)', + ), + 'type' => array( + 'type' => 'string', + 'description' => 'For delete action: "all" or "failed". Required for delete.', + ), + 'job_id' => array( + 'type' => 'integer', + 'description' => 'Job ID (for fail and retry actions)', + ), + 'reason' => array( + 'type' => 'string', + 'description' => 'Reason for failure (for fail action)', + ), ), + 'required' => array( 'action' ), ), ); } diff --git a/inc/Api/Chat/Tools/ManageLogs.php b/inc/Api/Chat/Tools/ManageLogs.php index a5301ee80..4937b844e 100644 --- a/inc/Api/Chat/Tools/ManageLogs.php +++ b/inc/Api/Chat/Tools/ManageLogs.php @@ -34,21 +34,22 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => $this->buildDescription(), 'parameters' => array( - 'action' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'Action to perform: "clear" or "get_metadata"', - ), - 'agent_id' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Agent ID to target. Omit to target all logs.', - ), - 'context' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Deprecated label only. Use agent_id instead.', + 'type' => 'object', + 'properties' => array( + 'action' => array( + 'type' => 'string', + 'description' => 'Action to perform: "clear" or "get_metadata"', + ), + 'agent_id' => array( + 'type' => 'integer', + 'description' => 'Agent ID to target. Omit to target all logs.', + ), + 'context' => array( + 'type' => 'string', + 'description' => 'Deprecated label only. Use agent_id instead.', + ), ), + 'required' => array( 'action' ), ), ); } diff --git a/inc/Api/Chat/Tools/ManageQueue.php b/inc/Api/Chat/Tools/ManageQueue.php index e0b0189ca..03da62afd 100644 --- a/inc/Api/Chat/Tools/ManageQueue.php +++ b/inc/Api/Chat/Tools/ManageQueue.php @@ -35,47 +35,43 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => $this->buildDescription(), 'parameters' => array( - 'action' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'Action to perform: "add", "list", "clear", "remove", "update", "move", or "mode"', - ), - 'flow_id' => array( - 'type' => 'integer', - 'required' => true, - 'description' => 'Flow ID', - ), - 'flow_step_id' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'Flow step ID', - ), - 'prompt' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Prompt text (for add and update actions)', - ), - 'index' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Queue index, 0-based (for remove and update actions)', - ), - 'from_index' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Source index for move action (0-based)', - ), - 'to_index' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Destination index for move action (0-based)', - ), - 'mode' => array( - 'type' => 'string', - 'required' => false, - 'enum' => array( 'drain', 'loop', 'static' ), - 'description' => 'Queue access mode for the "mode" action: drain (pop+discard), loop (pop+append-to-tail), static (peek-only).', + 'type' => 'object', + 'properties' => array( + 'action' => array( + 'type' => 'string', + 'description' => 'Action to perform: "add", "list", "clear", "remove", "update", "move", or "mode"', + ), + 'flow_id' => array( + 'type' => 'integer', + 'description' => 'Flow ID', + ), + 'flow_step_id' => array( + 'type' => 'string', + 'description' => 'Flow step ID', + ), + 'prompt' => array( + 'type' => 'string', + 'description' => 'Prompt text (for add and update actions)', + ), + 'index' => array( + 'type' => 'integer', + 'description' => 'Queue index, 0-based (for remove and update actions)', + ), + 'from_index' => array( + 'type' => 'integer', + 'description' => 'Source index for move action (0-based)', + ), + 'to_index' => array( + 'type' => 'integer', + 'description' => 'Destination index for move action (0-based)', + ), + 'mode' => array( + 'type' => 'string', + 'enum' => array( 'drain', 'loop', 'static' ), + 'description' => 'Queue access mode for the "mode" action: drain (pop+discard), loop (pop+append-to-tail), static (peek-only).', + ), ), + 'required' => array( 'action', 'flow_id', 'flow_step_id' ), ), ); } diff --git a/inc/Api/Chat/Tools/MergeTaxonomyTerms.php b/inc/Api/Chat/Tools/MergeTaxonomyTerms.php index 735d9c093..2c5c5f1db 100644 --- a/inc/Api/Chat/Tools/MergeTaxonomyTerms.php +++ b/inc/Api/Chat/Tools/MergeTaxonomyTerms.php @@ -29,26 +29,26 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Merge two taxonomy terms into one. Reassigns all posts from source term to target term, optionally merges meta data, then deletes the source term. Useful for consolidating duplicates.', 'parameters' => array( - 'source_term' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'Term to merge FROM (will be deleted) - ID, name, or slug', - ), - 'target_term' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'Term to merge INTO (will be kept) - ID, name, or slug', - ), - 'taxonomy' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'Taxonomy slug (venue, artist, category, post_tag, etc.)', - ), - 'merge_meta' => array( - 'type' => 'boolean', - 'required' => false, - 'description' => 'Fill empty target meta from source (default: true)', + 'type' => 'object', + 'properties' => array( + 'source_term' => array( + 'type' => 'string', + 'description' => 'Term to merge FROM (will be deleted) - ID, name, or slug', + ), + 'target_term' => array( + 'type' => 'string', + 'description' => 'Term to merge INTO (will be kept) - ID, name, or slug', + ), + 'taxonomy' => array( + 'type' => 'string', + 'description' => 'Taxonomy slug (venue, artist, category, post_tag, etc.)', + ), + 'merge_meta' => array( + 'type' => 'boolean', + 'description' => 'Fill empty target meta from source (default: true)', + ), ), + 'required' => array( 'source_term', 'target_term', 'taxonomy' ), ), ); } diff --git a/inc/Api/Chat/Tools/ReadLogs.php b/inc/Api/Chat/Tools/ReadLogs.php index 2e5538252..02768f9e3 100644 --- a/inc/Api/Chat/Tools/ReadLogs.php +++ b/inc/Api/Chat/Tools/ReadLogs.php @@ -34,40 +34,36 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => $this->buildDescription(), 'parameters' => array( - 'agent_id' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Agent ID to read logs for. Omit for all agents.', - ), - 'context' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Deprecated label only. Use agent_id instead.', - ), - 'mode' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Content mode: "recent" (default) or "full"', - ), - 'limit' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Max entries for recent mode (default: 200, max: 10000)', - ), - 'job_id' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Filter logs by job ID', - ), - 'pipeline_id' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Filter logs by pipeline ID', - ), - 'flow_id' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Filter logs by flow ID', + 'type' => 'object', + 'properties' => array( + 'agent_id' => array( + 'type' => 'integer', + 'description' => 'Agent ID to read logs for. Omit for all agents.', + ), + 'context' => array( + 'type' => 'string', + 'description' => 'Deprecated label only. Use agent_id instead.', + ), + 'mode' => array( + 'type' => 'string', + 'description' => 'Content mode: "recent" (default) or "full"', + ), + 'limit' => array( + 'type' => 'integer', + 'description' => 'Max entries for recent mode (default: 200, max: 10000)', + ), + 'job_id' => array( + 'type' => 'integer', + 'description' => 'Filter logs by job ID', + ), + 'pipeline_id' => array( + 'type' => 'integer', + 'description' => 'Filter logs by pipeline ID', + ), + 'flow_id' => array( + 'type' => 'integer', + 'description' => 'Filter logs by flow ID', + ), ), ), ); diff --git a/inc/Api/Chat/Tools/ReorderPipelineSteps.php b/inc/Api/Chat/Tools/ReorderPipelineSteps.php index d9d223b6f..9bc29cc8c 100644 --- a/inc/Api/Chat/Tools/ReorderPipelineSteps.php +++ b/inc/Api/Chat/Tools/ReorderPipelineSteps.php @@ -33,16 +33,19 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Reorder steps within a pipeline.', 'parameters' => array( - 'pipeline_id' => array( - 'type' => 'integer', - 'required' => true, - 'description' => 'ID of the pipeline', - ), - 'step_order' => array( - 'type' => 'array', - 'required' => true, - 'description' => 'Array of step order objects: [{pipeline_step_id: "...", execution_order: 0}, ...]', + 'type' => 'object', + 'properties' => array( + 'pipeline_id' => array( + 'type' => 'integer', + 'description' => 'ID of the pipeline', + ), + 'step_order' => array( + 'type' => 'array', + 'items' => array( 'type' => 'object' ), + 'description' => 'Array of step order objects: [{pipeline_step_id: "...", execution_order: 0}, ...]', + ), ), + 'required' => array( 'pipeline_id', 'step_order' ), ), ); } diff --git a/inc/Api/Chat/Tools/RunFlow.php b/inc/Api/Chat/Tools/RunFlow.php index c8b7f74f6..2d19f6977 100644 --- a/inc/Api/Chat/Tools/RunFlow.php +++ b/inc/Api/Chat/Tools/RunFlow.php @@ -35,21 +35,22 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Execute an existing flow immediately or schedule it for later. For IMMEDIATE execution: provide only flow_id (do NOT include timestamp). For SCHEDULED execution: provide flow_id AND a future Unix timestamp. Flows run asynchronously in the background. Use api_query with GET /datamachine/v1/jobs/{job_id} to check execution status.', 'parameters' => array( - 'flow_id' => array( - 'type' => 'integer', - 'required' => true, - 'description' => 'Flow ID to execute', - ), - 'count' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Number of times to run the flow (1-10, default 1). Each run spawns an independent job. Use this to process multiple items from a source.', - ), - 'timestamp' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'ONLY for scheduled execution: a future Unix timestamp. OMIT this parameter entirely for immediate execution. Cannot be combined with count > 1.', + 'type' => 'object', + 'properties' => array( + 'flow_id' => array( + 'type' => 'integer', + 'description' => 'Flow ID to execute', + ), + 'count' => array( + 'type' => 'integer', + 'description' => 'Number of times to run the flow (1-10, default 1). Each run spawns an independent job. Use this to process multiple items from a source.', + ), + 'timestamp' => array( + 'type' => 'integer', + 'description' => 'ONLY for scheduled execution: a future Unix timestamp. OMIT this parameter entirely for immediate execution. Cannot be combined with count > 1.', + ), ), + 'required' => array( 'flow_id' ), ), ); } diff --git a/inc/Api/Chat/Tools/SearchTaxonomyTerms.php b/inc/Api/Chat/Tools/SearchTaxonomyTerms.php index 6aafb9f5c..b8e84756c 100644 --- a/inc/Api/Chat/Tools/SearchTaxonomyTerms.php +++ b/inc/Api/Chat/Tools/SearchTaxonomyTerms.php @@ -29,21 +29,22 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Search existing taxonomy terms. Use to discover what terms exist before creating new ones or when configuring handler term assignments.', 'parameters' => array( - 'taxonomy' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'Taxonomy slug (category, post_tag, venue, artist, or other custom taxonomy)', - ), - 'search' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Search string to filter terms by name (partial match)', - ), - 'limit' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Maximum number of terms to return (default 20, max 100)', + 'type' => 'object', + 'properties' => array( + 'taxonomy' => array( + 'type' => 'string', + 'description' => 'Taxonomy slug (category, post_tag, venue, artist, or other custom taxonomy)', + ), + 'search' => array( + 'type' => 'string', + 'description' => 'Search string to filter terms by name (partial match)', + ), + 'limit' => array( + 'type' => 'integer', + 'description' => 'Maximum number of terms to return (default 20, max 100)', + ), ), + 'required' => array( 'taxonomy' ), ), ); } diff --git a/inc/Api/Chat/Tools/SendPing.php b/inc/Api/Chat/Tools/SendPing.php index f636762e7..c6516075f 100644 --- a/inc/Api/Chat/Tools/SendPing.php +++ b/inc/Api/Chat/Tools/SendPing.php @@ -34,26 +34,26 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Send a ping to one or more webhook URLs. Useful for triggering external agents or notifying services.', 'parameters' => array( - 'webhook_url' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'URL(s) to POST data to. Accepts a single URL or newline-separated string of URLs.', - ), - 'prompt' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'Optional instructions for the receiving agent', - ), - 'flow_id' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Flow ID for context', - ), - 'pipeline_id' => array( - 'type' => 'integer', - 'required' => false, - 'description' => 'Pipeline ID for context', + 'type' => 'object', + 'properties' => array( + 'webhook_url' => array( + 'type' => 'string', + 'description' => 'URL(s) to POST data to. Accepts a single URL or newline-separated string of URLs.', + ), + 'prompt' => array( + 'type' => 'string', + 'description' => 'Optional instructions for the receiving agent', + ), + 'flow_id' => array( + 'type' => 'integer', + 'description' => 'Flow ID for context', + ), + 'pipeline_id' => array( + 'type' => 'integer', + 'description' => 'Pipeline ID for context', + ), ), + 'required' => array( 'webhook_url' ), ), ); } diff --git a/inc/Api/Chat/Tools/SetHandlerDefaults.php b/inc/Api/Chat/Tools/SetHandlerDefaults.php index 9a0ef6e4d..0ab559600 100644 --- a/inc/Api/Chat/Tools/SetHandlerDefaults.php +++ b/inc/Api/Chat/Tools/SetHandlerDefaults.php @@ -29,16 +29,18 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Set site-wide handler defaults. Use to establish standard configuration values that apply to all new flows. For example, setting post_author and include_images defaults for upsert_event.', 'parameters' => array( - 'handler_slug' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'Handler slug to set defaults for (e.g., upsert_event, eventbrite)', - ), - 'defaults' => array( - 'type' => 'object', - 'required' => true, - 'description' => 'Default configuration values to set. Keys should match handler config fields.', + 'type' => 'object', + 'properties' => array( + 'handler_slug' => array( + 'type' => 'string', + 'description' => 'Handler slug to set defaults for (e.g., upsert_event, eventbrite)', + ), + 'defaults' => array( + 'type' => 'object', + 'description' => 'Default configuration values to set. Keys should match handler config fields.', + ), ), + 'required' => array( 'handler_slug', 'defaults' ), ), ); } diff --git a/inc/Api/Chat/Tools/SystemHealthCheck.php b/inc/Api/Chat/Tools/SystemHealthCheck.php index 99971653d..ce5b99a07 100644 --- a/inc/Api/Chat/Tools/SystemHealthCheck.php +++ b/inc/Api/Chat/Tools/SystemHealthCheck.php @@ -34,15 +34,17 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Run unified health diagnostics for Data Machine and extensions. Returns status of various system components.', 'parameters' => array( - 'types' => array( - 'type' => 'array', - 'required' => false, - 'description' => 'Check types to run. Use "all" for all default checks, or specific type IDs. Omit for all checks.', - ), - 'options' => array( - 'type' => 'object', - 'required' => false, - 'description' => 'Type-specific options (scope, limit, url, etc.)', + 'type' => 'object', + 'properties' => array( + 'types' => array( + 'type' => 'array', + 'items' => array( 'type' => 'string' ), + 'description' => 'Check types to run. Use "all" for all default checks, or specific type IDs. Omit for all checks.', + ), + 'options' => array( + 'type' => 'object', + 'description' => 'Type-specific options (scope, limit, url, etc.)', + ), ), ), ); diff --git a/inc/Api/Chat/Tools/UpdateFlow.php b/inc/Api/Chat/Tools/UpdateFlow.php index 73bb0060a..1a4511d55 100644 --- a/inc/Api/Chat/Tools/UpdateFlow.php +++ b/inc/Api/Chat/Tools/UpdateFlow.php @@ -33,21 +33,22 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Update flow title and/or scheduling.', 'parameters' => array( - 'flow_id' => array( - 'type' => 'integer', - 'required' => true, - 'description' => 'Flow ID', - ), - 'flow_name' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'New flow title', - ), - 'scheduling_config' => array( - 'type' => 'object', - 'required' => false, - 'description' => 'Schedule: {interval: value}. Valid intervals:' . "\n" . SchedulingDocumentation::getIntervalsJson(), + 'type' => 'object', + 'properties' => array( + 'flow_id' => array( + 'type' => 'integer', + 'description' => 'Flow ID', + ), + 'flow_name' => array( + 'type' => 'string', + 'description' => 'New flow title', + ), + 'scheduling_config' => array( + 'type' => 'object', + 'description' => 'Schedule: {interval: value}. Valid intervals:' . "\n" . SchedulingDocumentation::getIntervalsJson(), + ), ), + 'required' => array( 'flow_id' ), ), ); } diff --git a/inc/Api/Chat/Tools/UpdateTaxonomyTerm.php b/inc/Api/Chat/Tools/UpdateTaxonomyTerm.php index 4454ec6fc..9fd12f63f 100644 --- a/inc/Api/Chat/Tools/UpdateTaxonomyTerm.php +++ b/inc/Api/Chat/Tools/UpdateTaxonomyTerm.php @@ -29,41 +29,38 @@ public function getToolDefinition(): array { 'method' => 'handle_tool_call', 'description' => 'Update an existing taxonomy term. Can modify core fields (name, slug, description, parent) and custom term meta (venue_address, venue_capacity, etc.). Use search_taxonomy_terms first to find the term to update.', 'parameters' => array( - 'term' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'Term identifier - can be term ID, name, or slug', - ), - 'taxonomy' => array( - 'type' => 'string', - 'required' => true, - 'description' => 'Taxonomy slug (venue, artist, category, post_tag, or custom taxonomy)', - ), - 'name' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'New term name', - ), - 'slug' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'New term slug (URL-friendly identifier)', - ), - 'description' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'New term description', - ), - 'parent' => array( - 'type' => 'string', - 'required' => false, - 'description' => 'New parent term (ID, name, or slug) - hierarchical taxonomies only', - ), - 'meta' => array( - 'type' => 'object', - 'required' => false, - 'description' => 'Key-value pairs of term meta to update (e.g., venue_address, venue_capacity). Keys starting with "_" are protected and cannot be modified.', + 'type' => 'object', + 'properties' => array( + 'term' => array( + 'type' => 'string', + 'description' => 'Term identifier - can be term ID, name, or slug', + ), + 'taxonomy' => array( + 'type' => 'string', + 'description' => 'Taxonomy slug (venue, artist, category, post_tag, or custom taxonomy)', + ), + 'name' => array( + 'type' => 'string', + 'description' => 'New term name', + ), + 'slug' => array( + 'type' => 'string', + 'description' => 'New term slug (URL-friendly identifier)', + ), + 'description' => array( + 'type' => 'string', + 'description' => 'New term description', + ), + 'parent' => array( + 'type' => 'string', + 'description' => 'New parent term (ID, name, or slug) - hierarchical taxonomies only', + ), + 'meta' => array( + 'type' => 'object', + 'description' => 'Key-value pairs of term meta to update (e.g., venue_address, venue_capacity). Keys starting with "_" are protected and cannot be modified.', + ), ), + 'required' => array( 'term', 'taxonomy' ), ), ); }