'plugins/list-plugins', 'args' => array( 'label' => __( 'List Plugins', 'acrossai-abilities-manager' ), 'description' => __( 'List all installed WordPress plugins, optionally filtered by status.', 'acrossai-abilities-manager' ), 'category' => 'acrossai-plugins', 'execute_callback' => array( $this, 'execute' ), 'permission_callback' => static function (): bool { return current_user_can( 'manage_options' ); }, 'input_schema' => array( 'type' => 'object', 'properties' => array( 'status' => array( 'type' => 'string', 'enum' => array( 'all', 'active', 'inactive' ), 'default' => 'all', 'description' => __( 'Filter plugins by status.', 'acrossai-abilities-manager' ), ), ), 'additionalProperties' => false, ), 'output_schema' => array( 'type' => 'object', 'properties' => array( 'plugins' => array( 'type' => 'array' ), 'total' => array( 'type' => 'integer' ), 'active' => array( 'type' => 'integer' ), ), ), 'meta' => array( 'acrossai' => array( 'tab_group' => 'updates', 'sub_group' => 'info', 'sub_group_label' => __( 'Info', 'acrossai-abilities-manager' ), ), 'show_in_rest' => true, 'mcp' => array( 'public' => false, 'type' => 'tool', ), 'annotations' => array( 'readonly' => true, 'destructive' => false, 'idempotent' => true, ), ), ), ); } /** * Execute the ability. * * @param array $input Ability input payload. * @return array */ public function execute( array $input = array() ): array { $status = isset( $input['status'] ) ? sanitize_text_field( $input['status'] ) : 'all'; if ( ! in_array( $status, array( 'all', 'active', 'inactive' ), true ) ) { $status = 'all'; } return Plugin_Helpers::get_all_plugins( $status ); } }